virtualenv的报错,pipenv安装使用

dyld: Library not loaded: @rpath/libpython3.6m.dylib
  Referenced from: /Users/.local/share/virtualenvs/customer-base-6LCBHv92/bin/python
  Reason: image not found
ERROR: The executable /Users/.local/share/virtualenvs/customer-base-6LCBHv92/bin/python is not functioning
ERROR: It thinks sys.prefix is '/Users/GitHub/customer-base' (should be '/Users/.local/share/virtualenvs/customer-base-6LCBHv92')
ERROR: virtualenv is not compatible with this system or executable

可以解决问题的方法

查百度很多都是路径有中文报错的,而我路径没有中文怎么会报错呢

最后发现是 Anaconda 和 virtualenv 的冲突需要先使用 pip 卸载 virtualenv

再使用 conda 安装 virtualenv 最后再安装 pipenv 就可以了

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
brew install pipenv

pipenv --three 会使用当前系统的Python3创建环境

pipenv --python 3.6 指定某一Python版本创建环境

pipenv shell 激活虚拟环境

pipenv --where 显示目录信息

pipenv --venv 显示虚拟环境信息

pipenv --py 显示Python解释器信息

pipenv install requests 安装相关模块并加入到Pipfile

pipenv install django==1.11 安装固定版本模块并加入到Pipfile

pipenv graph 查看目前安装的库及其依赖

pipenv check检查安全漏洞

pipenv uninstall --all 卸载全部包并从Pipfile中移除

阅读 6.4k
1 个回答

pip3 install --upgrade pipenv

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进