Mac 上的 Virtualenv 和 pip,它会自动获取环境吗?
python 的 pip 和 virutalenv 是否会根据您所在的文件夹自动检测 virtualenv(类似于 ruby 和 rvm 的做法)?
即我可能有很多虚拟环境,并且当我刚刚通过项目时它会自动更改环境?
Does python's pip with virutalenv automatically detect the virtualenv based on the folder you are on (similar to how ruby and rvm does)?
i.e. I may have many virtual environments, and as I just through projects it will automatically change the environment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,virtualenv 不会根据您当前的工作目录激活。要激活 virtualenv,请从要激活的特定 virtualenv 的文件夹中运行
source ../bin/activate
命令。No, virtualenv's are not activated based on your current working directory. To activate a virtualenv, run the
source ../bin/activate
command from the folder of the specific virtualenv you wish to activate.据我所知,不,不会。我最近开始使用 virtualenvwrapper,它为您提供了一组快速且简单的命令创建虚拟环境并在虚拟环境之间切换。虽然这不完全是您问题的答案,但您可能会发现这很有用。
As far as I know, no, it won't. I've recently started using virtualenvwrapper, which provides you with a quick and easy set of commands to create and switch between virtualenvs. Whilst not exactly an answer to your question, you may find this of some use.