我正在学习本教程http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world/page/5
当我virtualenv flask
命令时,我收到此错误消息:
Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
Run Code Online (Sandbox Code Playgroud)
这是有道理的,因为virtualenv的目的是创建一个你可以控制的新环境,--user
命令将所有内容放在一个特定的位置,从而破坏开发环境分离的目标.
看来pip默认--user
安装,我可以更改此默认行为吗?而且,更好的是,我可以随时获得与virtualenv一起玩的好处吗?
为了澄清,这是我的终端的样子.
MELCHIOR:miguelgrinberg-microblog megablanc$ virtualenv flask
New python executable in flask/bin/python
Installing setuptools, pip, wheel...
Complete output from command /Users/megablanc/Dev...log/flask/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File …
Run Code Online (Sandbox Code Playgroud) 我正在尝试模拟对第三方服务的一些 API 调用以进行单元测试。我真的只是希望这个模拟函数RestEase.Response<...>
每次都返回相同的值。
// Setup
var VeracrossMock = new Mock<IVeracrossAPI>(MockBehavior.Strict);
Func<List<VeracrossStudent>> func = () => new List<VeracrossStudent>() { new VeracrossStudent() { First_name = "Bob", Last_name = "Lob" } };
RestEase.Response<List<VeracrossStudent>> resp = new RestEase.Response<List<VeracrossStudent>>("", new HttpResponseMessage(HttpStatusCode.OK), func);
// Problem is on the line below
VeracrossMock.Setup(api => api.GetStudentsAsync(1, null, CancellationToken.None)).ReturnsAsync<RestEase.Response<List<VeracrossStudent>>>(resp);
Run Code Online (Sandbox Code Playgroud)
它给了我一个红色下划线,然后声称ReturnsAsync
不存在,或者至少不存在我给出的论点。
Error CS1929 'ISetup<IVeracrossAPI, Task<Response<List<VeracrossStudent>>>>' does not contain a definition for 'ReturnsAsync' and the best extension method overload 'SequenceExtensions.ReturnsAsync<Response<List<VeracrossStudent>>>(ISetupSequentialResult<Task<Response<List<VeracrossStudent>>>>, Response<List<VeracrossStudent>>)' requires a receiver of type 'ISetupSequentialResult<Task<Response<List<VeracrossStudent>>>>'
Run Code Online (Sandbox Code Playgroud)
我应该如何使用 …
所以我无法加载 ROracle。我确实对此很陌生,因此任何信息都值得赞赏,任何有关提供哪些进一步信息的信息也会有所帮助。
> library(ROracle)
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '~/R/x86_64-pc-linux-gnu-library/2.14/ROracle/libs/ROracle.so':
libclntsh.so.11.1: cannot open shared object file: No such file or directory
Error: package/namespace load failed for ‘ROracle’
Run Code Online (Sandbox Code Playgroud)
ROracle.so 正是它所说的位置。libclntsh.so.11.1 可以在/usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1
. 这是结果.libPaths
:
> .libPaths()
[1] "/home/nguiller/R/x86_64-pc-linux-gnu-library/2.14" "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
[4] "/usr/lib/R/library" "/usr/lib/rstudio/R/library"
Run Code Online (Sandbox Code Playgroud)
我的 .Renviron 文件
LD_LIBRARY_PATH="/usr/lib/oracle/11.2/client64/lib:/home/nguiller/Downloads/instantclient_11_2"
ORACLE_HOME="/usr/lib/oracle/11.2/client64/:/home/nguiller/Downloads/instantclient_11_2"
OCI_LIB="/usr/lib/oracle/11.2/client64/lib"
Run Code Online (Sandbox Code Playgroud)
由于 OCI 库,我在开始安装 ROracle 时遇到了很多麻烦,但它最终与 R CMD INSTALL --configure-ags='--with-oci-lib=/usr/lib/oracle/11.2/client64/lib --with-oci-inc=/usr/include/oracle/11.2/client64' ROracle_1.1-8.tar.gz
让我知道我可以如何提供帮助。
当我想将其保留为控制台应用程序时(最终将保留),我看到的每个示例都使用 Form ,因此在此方面并没有走得太远。
以下代码每次使用EIPAbstractError: IPProcs is not defined. Make sure IPPeerCommon() is in the uses clauses
.
将其添加到 Uses 子句中 No peer with the interface guid [xxx-xx...]
program EMV_ConsoleTest;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils, REST.Client;
var
LClient: TRESTClient;
begin
try
LClient := TRESTClient.Create('http://localhost:9000/');
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
Run Code Online (Sandbox Code Playgroud) 我得到以下行为。在此settings.py
代码段中,从第33行点击“ o”
31# Application definition
32
33 INSTALLED_APPS = [
34 'rest_framework',
Run Code Online (Sandbox Code Playgroud)
我明白了
31# Application definition
32
33 INSTALLED_APPS = [
34 |<-cursor is here, two indents, 8 spaces
35 'rest_framework',
Run Code Online (Sandbox Code Playgroud)
我真正想要的是一个缩进或总共4个空格,与列表的其余部分一致。是什么赋予了?我正在使用以下.vimrc文件,我从这里开始大多抄写。
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Add …
Run Code Online (Sandbox Code Playgroud)