草庐IT

virtualenv-reqs

全部标签

python - 如何为 crontab 设置 virtualenv?

我想设置一个crontab来运行Python脚本。假设脚本是这样的:#!/usr/bin/pythonprint"helloworld"有没有一种方法可以为该Python脚本指定一个virtualenv来运行?在shell中我会这样做:~$workonmyenv我可以在crontab中做些什么来激活virtualenv吗? 最佳答案 IstheresomethingequivalentIcoulddoincrontabtoactivateavirtualenv?这对我很有效...##callvirtualenvpythonfromc

python - 使用 virtualenv 或 buildout 安装 PIL 的问题

当我使用easy_install或buildout安装PIL时,它会以这样的方式安装,我必须执行“importImage”,而不是“fromPILimportImage”。但是,如果我执行“apt-getinstallpython-imaging”或使用“pip-Etest_pilinstallPIL”,一切正常。以下是我如何尝试使用virtualenv安装PIL的示例:#virtualenv--no-site-packagestest_pil#test_pil/bin/easy_installPIL#test_pil/bin/pythonPython2.5.1(r251:54863,

python - 使用 virtualenv 或 buildout 安装 PIL 的问题

当我使用easy_install或buildout安装PIL时,它会以这样的方式安装,我必须执行“importImage”,而不是“fromPILimportImage”。但是,如果我执行“apt-getinstallpython-imaging”或使用“pip-Etest_pilinstallPIL”,一切正常。以下是我如何尝试使用virtualenv安装PIL的示例:#virtualenv--no-site-packagestest_pil#test_pil/bin/easy_installPIL#test_pil/bin/pythonPython2.5.1(r251:54863,

python - Mac + virtualenv + pip + postgresql = 错误 : pg_config executable not found

我试图为教程安装postgres,但pip给了我错误:pipinstallpsycopg我得到的错误片段:Error:pg_configexecutablenotfound.Pleaseaddthedirectorycontainingpg_configtothePATHorspecifythefullexecutablepathwiththeoption:pythonsetup.pybuild_ext--pg-config/path/to/pg_configbuild...orwiththepg_configoptionin'setup.cfg'.我的virtualenv中的pg_c

python - Mac + virtualenv + pip + postgresql = 错误 : pg_config executable not found

我试图为教程安装postgres,但pip给了我错误:pipinstallpsycopg我得到的错误片段:Error:pg_configexecutablenotfound.Pleaseaddthedirectorycontainingpg_configtothePATHorspecifythefullexecutablepathwiththeoption:pythonsetup.pybuild_ext--pg-config/path/to/pg_configbuild...orwiththepg_configoptionin'setup.cfg'.我的virtualenv中的pg_c

python - 如何在 Bash 脚本中激活 virtualenv

如何创建Bash脚本来激活Pythonvirtualenv?我的目录结构如下:.envbinactivate...othervirtualenvfiles...srcshell.sh...mycode...我可以通过以下方式激活我的virtualenv:user@localhost:src$.../.env/bin/activate(.env)user@localhost:src$但是,在Bash脚本中执行相同的操作不会:user@localhost:src$catshell.sh#!/bin/bash.../.env/bin/activateuser@localhost:src$./

python - 如何在 Bash 脚本中激活 virtualenv

如何创建Bash脚本来激活Pythonvirtualenv?我的目录结构如下:.envbinactivate...othervirtualenvfiles...srcshell.sh...mycode...我可以通过以下方式激活我的virtualenv:user@localhost:src$.../.env/bin/activate(.env)user@localhost:src$但是,在Bash脚本中执行相同的操作不会:user@localhost:src$catshell.sh#!/bin/bash.../.env/bin/activateuser@localhost:src$./

python - django 生产服务器是否推荐使用 virtualenv?

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题吗?更新问题,以便editingthispost提供事实和引用来回答它.关闭4年前。Improvethisquestion我一直使用virtualenv在localhost中测试我的应用程序,因为我有隔离环境并且可以安全地测试新版本的软件包。现在是我必须将我的应用程序部署到生产服务器的时候了。我想知道我是否也应该将virtualenv用于生产服务器,或者只是正常安装。由于它是生产服务器,因此我始终可以使用我在开发服务器中测试过的正确版本(在virtual-env下) 最佳答案

python - django 生产服务器是否推荐使用 virtualenv?

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题吗?更新问题,以便editingthispost提供事实和引用来回答它.关闭4年前。Improvethisquestion我一直使用virtualenv在localhost中测试我的应用程序,因为我有隔离环境并且可以安全地测试新版本的软件包。现在是我必须将我的应用程序部署到生产服务器的时候了。我想知道我是否也应该将virtualenv用于生产服务器,或者只是正常安装。由于它是生产服务器,因此我始终可以使用我在开发服务器中测试过的正确版本(在virtual-env下) 最佳答案

Python Virtualenv - 没有名为 virtualenvwrapper.hook_loader 的模块

我运行的是MacOS10.6.8。除了python2.6之外,还想安装python2.7并在新的virtualenv中使用python2.7。我执行了以下步骤:我下载了python2.7并安装了它:http://www.python.org/ftp/python/2.7.3/python-2.7.3-macosx10.6.dmg然后我运行命令以使用python2.7设置新的virtualenv:mkvirtualenv--python=python2.7mynewenv我的.bash_profile如下所示:#neededforvirtualenvwrapperexportWORKON