草庐IT

virtualenv-gtk

全部标签

python - 你如何使用 pip、virtualenv 和 Fabric 来处理部署?

您的设置、技巧,尤其是您的工作流程是什么?这些工具很棒,但它们的使用仍然没有最佳实践,所以我不知道使用它们的最有效方法是什么。您使用pip捆绑或总是下载?您是手动设置Apache/Cherokee/MySQL还是自己设置你有那个脚本吗?你把所有的东西都放在virtualenv里了吗?并使用--no-site-packages?您是否将一个virtualenv用于多个项目?你用什么Fabric对于(哪一部分你的部署脚本)?您将Fabric脚本放在客户端还是服务器上?您如何处理数据库和媒体文件迁移?您是否需要诸如SCons之类的构建工具??您的部署步骤是什么?您多久执行一次?等等

python - 如何为 crontab 设置 virtualenv?

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

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下) 最佳答案