【发布时间】:2015-04-22 03:56:25
【问题描述】:
谁能告诉我如何在我的 Mac 上快速切换以下 Python 可执行文件?
我希望能够在一个特定的虚拟环境中规定使用 psiTurk 所需的 Enthought Canopy 可执行文件
- “本机到计算机”/usr/local/bin/python
- “本地到虚拟环境”/Users/brendan/Dropbox/workspace/psiturktestfive
- “Enthought Canopy”/Users/brendan/Library/Enthought/Canopy_64bit/User/bin/python
- ".bash_profile" /Library/Frameworks/Python.framework/Versions/2.7/bin/python
是否有一个简单的终端命令可以做到这一点?
目前,如果我编辑我的 .bash_profile,我只能让我的机器使用 Enthought Canpy 版本,但是一旦我为项目激活新的虚拟环境,就会切换到虚拟环境本地 python 可执行文件
任何帮助都一如既往,非常感谢。
编辑:
以下错误是我尝试使用virtualenv -p /Users/brendan/Library/Enthought/Canopy_64bit/User/bin/python canopy时收到的错误
localhost:workspace brendan$ virtualenv -p /Users/brendan/Library/Enthought/Canopy_64bit/User/bin/python canopy
Running virtualenv with interpreter /Users/brendan/Library/Enthought/Canopy_64bit/User/bin/python
Using base prefix '/Applications/Canopy.app/appdata/canopy-1.4.1.1975.macosx-x86_64/Canopy.app/Contents'
New python executable in canopy/bin/python
dyld: Library not loaded: @rpath/Python
Referenced from: /Users/brendan/Dropbox/workspace/canopy/bin/python
Reason: image not found
ERROR: The executable canopy/bin/python is not functioning
ERROR: It thinks sys.prefix is u'/Users/brendan/Dropbox/workspace' (should be u'/Users/brendan/Dropbox/workspace/canopy')
ERROR: virtualenv is not compatible with this system or executable
localhost:workspace brendan$
【问题讨论】:
标签: python python-2.7 virtualenv