使用OSX 10.9.2
刚刚掌握virtualenv和virtualenvwrapper。我遇到的问题是我使用virtualenv创建的环境在终端和finder中都可见,但我使用virtualenvwrapper创建的环境不是。
以下是我在终端中采取的步骤。
virtualenv virt_env/virt1 --no-site-packages
成功创建名为virt1
的virtualenvsource virt1/bin/activate
激活virtualenv
(virt1)localhost:virt_env brendan$
我有几个这样的虚拟环境设置和工作,我能够按照我的预期在每个虚拟环境中安装软件包。我可以在它们之间切换并根据需要删除它们。我也可以在Finder和Terminal中看到它们。
然而,当我使用virtualenvwrapper创建虚拟环境时,似乎我能够使用它们但我无法看到它们。
以下是我使用virtualenvwrapper
采取的步骤localhost:~ brendan$ mkvirtualenv virt_env/virt4
New python executable in virt_env/virt4/bin/python
Installing setuptools, pip...done.
(virt4)localhost:~ brendan$
我可以使用此功能,例如
(virt4)localhost:~ brendan$ sudo easy_install yolk
我可以停用并重新激活它。 e.g。
deactivate
localhost:~ brendan$
workon virt_env/virt4
(virt4)localhost:~ brendan$
但是当我进入finder时,我只能看到我通过virtualenv创建的环境(virt1,virt2,virt3),而不是我使用virtualenvwrapper创建的环境(virt4)
我正在使用这些教程
答案 0 :(得分:1)
确保您已定义了WORKON_HOME
环境变量,以告诉virtualenvwrapper放置环境的位置(请参阅documentation)
答案 1 :(得分:1)
MacOS X是一个基于Unix的系统,因此不会列出名称以点开头的文件和目录。你可能正在存储你的virtualenvs是一个名为.virtualenvs的目录,因此它是不可见的。
有关如何找到讨厌的事情的详细信息,请参阅http://www.macosxtips.co.uk/index_files/quickly-show-hidden-files.php