草庐IT

virtualenv-reqs

全部标签

python - 如何在 virtualenv 中安装包?

我使用以下命令创建了一个virtualenv。mkvirtualenv--distribute--system-site-packages"$1"使用workon启动virtualenv后,我输入ipython。它提示我WARNING:Attemptingtoworkinavirtualenv.Ifyouencounterproblems,pleaseinstallIPythoninsidethevirtualenv.当我尝试使用virtualenv安装ipython时,我收到以下错误消息:pipinstallipythonRequirementalreadysatisfied(use

python - 如何更改默认的 virtualenv 提示?

如何更改默认的Virtualenvwrapper提示?默认情况下,使用workon之类的命令在特定的虚拟环境中工作在提示符前添加virtualenv的名称。如果您不使用默认命令提示符,这可能效果不佳。 最佳答案 如果您正在使用自定义PS1(当我发现这个问题时),我建议您禁用提示更改,使用exportVIRTUAL_ENV_DISABLE_PROMPT=1(参见virtualenvdocs),然后您自己的virtualenv提示符,以便添加到您的PS1。查看我使用过的这段代码:functionvirtualenv_info(){#Ge

python - 如何更改默认的 virtualenv 提示?

如何更改默认的Virtualenvwrapper提示?默认情况下,使用workon之类的命令在特定的虚拟环境中工作在提示符前添加virtualenv的名称。如果您不使用默认命令提示符,这可能效果不佳。 最佳答案 如果您正在使用自定义PS1(当我发现这个问题时),我建议您禁用提示更改,使用exportVIRTUAL_ENV_DISABLE_PROMPT=1(参见virtualenvdocs),然后您自己的virtualenv提示符,以便添加到您的PS1。查看我使用过的这段代码:functionvirtualenv_info(){#Ge

python - pip install PIL 失败

我正在尝试安装pip包PIL。但是安装不起作用并引发以下错误。Couldnotfindaversionthatsatisfiestherequirementpil(fromxhtml2pdf==0.0.4->-rvirtualenv-reqs.txt(line16))(fromversions:)Someexternallyhostedfileswereignoredasaccesstothemmaybeunreliable(use--allow-externalpiltoallow).Nomatchingdistributionfoundforpil(fromxhtml2pdf==0

python - pip install PIL 失败

我正在尝试安装pip包PIL。但是安装不起作用并引发以下错误。Couldnotfindaversionthatsatisfiestherequirementpil(fromxhtml2pdf==0.0.4->-rvirtualenv-reqs.txt(line16))(fromversions:)Someexternallyhostedfileswereignoredasaccesstothemmaybeunreliable(use--allow-externalpiltoallow).Nomatchingdistributionfoundforpil(fromxhtml2pdf==0

python - 如何使用 virtualenv 运行 uwsgi

我目前正在开发我的第一个真正的pythonflask项目,并且即将设置构建服务器以部署在每次checkin时构建的“最新构建”。我已经设置了一个启动脚本,我在其中使用uwsgi启动应用程序,这部分工作正常。我最近也开始使用virtualenv并通过这样做将安装的包添加到我的项目中的projectname\flask\Lib\site-packages下。我使用nginx作为Web服务器,配置如下:location/{try_files$uri@graderbuild;}location@graderbuild{includeuwsgi_params;uwsgi_paramUWSGI_C

python - 如何使用 virtualenv 运行 uwsgi

我目前正在开发我的第一个真正的pythonflask项目,并且即将设置构建服务器以部署在每次checkin时构建的“最新构建”。我已经设置了一个启动脚本,我在其中使用uwsgi启动应用程序,这部分工作正常。我最近也开始使用virtualenv并通过这样做将安装的包添加到我的项目中的projectname\flask\Lib\site-packages下。我使用nginx作为Web服务器,配置如下:location/{try_files$uri@graderbuild;}location@graderbuild{includeuwsgi_params;uwsgi_paramUWSGI_C

python - 如何从虚拟环境 (virtualenv) 启动 python Idle

我有一个从虚拟环境安装的包。如果我只是启动python解释器,则可以很好地导入该包。但是,如果我启动Idle,则无法导入该包(因为它仅在一个特定的virtualenv中可用而不是全局的)。如何从virtualenv启动Idle,以便virtualenv中的所有包都可用? 最佳答案 简答启动虚拟环境运行python-midlelib.idle来自thisanswer.长答案此答案假定Python3。有几种不同的虚拟环境管理器,每一种都有稍微不同的方式来处理python的安装位置和运行方式,asdetailedinthisanswer.

python - 如何从虚拟环境 (virtualenv) 启动 python Idle

我有一个从虚拟环境安装的包。如果我只是启动python解释器,则可以很好地导入该包。但是,如果我启动Idle,则无法导入该包(因为它仅在一个特定的virtualenv中可用而不是全局的)。如何从virtualenv启动Idle,以便virtualenv中的所有包都可用? 最佳答案 简答启动虚拟环境运行python-midlelib.idle来自thisanswer.长答案此答案假定Python3。有几种不同的虚拟环境管理器,每一种都有稍微不同的方式来处理python的安装位置和运行方式,asdetailedinthisanswer.

python - 无法在 Windows 的 GIT bash mingw32 中激活 virtualenv

当我尝试从GITbashmingw32激活我的virtualenv时,我没有得到预期的响应。注意:py是我的GoogleDrive文件夹中Python项目的文件夹。hy是我运行virtualenv--distributehy时创建的virtualenv文件夹。s3z@s3z~/GoogleDrive/py/hy$Scripts/activate所以你看,在s3z@s3z~/GoogleDrive/py/hy之前没有出现预期的(hy)s3z@s3z~/GoogleDrive/py/hy$Scripts/activate.batScripts/activate.bat:line1:@ech