`dyld: Library not loaded` 错误阻止 virtualenv 加载 [英] `dyld: Library not loaded` error preventing virtualenv from loading

查看:25
本文介绍了`dyld: Library not loaded` 错误阻止 virtualenv 加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When I tried creating a virtual environment with python using the command virtualenv venv from Terminal, I got the following error:

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

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

I'm not the first person to encounter a similar error -- I tried following this answer's recommendations and running:

gfind ~/.virtualenvs/my-virtual-env/ -type l -xtype l -delete

那没有帮助.也没有运行 sudo virtualenv venv 来作为超级用户运行命令.

That didn't help. Nor did running sudo virtualenv venv to run commmand as a super user.

接下来我应该调查什么?

What should I investigate next?

推荐答案

我收到了完全相同的错误消息.Continuum Analytics Support Group 的 Ray Donnelly 提供了以下解决方案,为我解决了这个问题:

I had the exact same error message. Ray Donnelly at Continuum Analytics Support Group provided the following solution, which resolved the issue for me:

当你 pip 安装 virtualenvwrapper 时,pip 就会安装virtualenv 为您服务,因为它是一个依赖项.不幸的是,那virtualenv 与 Anaconda Python 不兼容.幸运的是,该Anaconda Distribution 有一个兼容的 virtualenv.修理这个:

When you pip installed virtualenvwrapper, pip will have installed virtualenv for you as it is a dependency. Unfortunately, that virtualenv is not compatible with Anaconda Python. Fortunately, the Anaconda Distribution has a virtualenv that is compatible. To fix this:

pip uninstall virtualenv
conda install virtualenv

无法让 virtualenv 与 anaconda3 v4 一起使用.3 在 Mac 上

这篇关于`dyld: Library not loaded` 错误阻止 virtualenv 加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆