`dyld:Library not loaded`错误阻止virtualenv加载

zth*_*.nc 19 python virtualenv

当我尝试使用virtualenv venv来自终端的命令使用python创建虚拟环境时,我收到以下错误:

Using base prefix '/Users/zacharythomas/anaconda3'
New python executable in /Users/zacharythomas/venv/bin/python
dyld: Library not loaded: @rpath/libpython3.6m.dylib
Referenced from: /Users/zacharythomas/venv/bin/python
Reason: image not found
ERROR: The executable /Users/zacharythomas/venv/bin/python is not functioning
ERROR: It thinks sys.prefix is '/Users/zacharythomas' (should be '/Users/zacharythomas/venv')
ERROR: virtualenv is not compatible with this system or executable
Run Code Online (Sandbox Code Playgroud)

我不是第一个遇到类似错误的人 - 我尝试按照这个答案的建议并运行:

gfind ~/.virtualenvs/my-virtual-env/ -type l -xtype l -delete
Run Code Online (Sandbox Code Playgroud)

这没有用.也没有sudo virtualenv venv像超级用户一样运行命令.

我接下来应该调查什么?

use*_*447 50

我有完全相同的错误消息.Continuum Analytics支持小组的Ray Donnelly提供了以下解决方案,为我解决了这个问题:

当您点击已安装的virtualenvwrapper时,pip将为您安装virtualenv,因为它是一个依赖项.不幸的是,virtualenv与Anaconda Python不兼容.幸运的是,Anaconda Distribution有一个兼容的virtualenv.解决这个问题:

pip uninstall virtualenv
conda install virtualenv
Run Code Online (Sandbox Code Playgroud)

无法让virtualenv在mac上使用anaconda3 v4.3