venv Python使用不正确的sys.prefix

时间:2013-07-10 10:21:56

标签: python virtualenv enthought

我在mac Mountain Lion上运行64位版本:1.0.3.1262。我已经使用easy_install安装了virtualenv。但是当我尝试执行命令时:

virtualenv venv --distribute

它显示以下错误:

Using base prefix '/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents'
New python executable in venv/bin/python
dyld: Library not loaded: @rpath/Python
Referenced from: /Users/xxx/Desktop/untitled folder 2/venv/bin/python
Reason: image not found
ERROR: The executable venv/bin/python is not functioning
ERROR: It thinks sys.prefix is u'/Users/xxx/Desktop/untitled folder 2' (should be u'/Users/xxx/Desktop/untitled folder 2/venv')
ERROR: virtualenv is not compatible with this system or executable 

有没有人有类似的问题并解决了?提前感谢您提出宝贵意见。

1 个答案:

答案 0 :(得分:3)

Canopy使用venv代替virtualenv

尝试设置您的环境:

venv -s path/to/virtual_environment_dir

取自:https://support.enthought.com/entries/21802240-Use-venv-not-virtualenv-with-Canopy-Python

或者如果您要设置没有系统站点包的环境:Setting up a virtural enviroment (venv) with no system site packages