我正在尝试使virtualenvwrapper运行。
我安装它:

sudo pip install virtualenvwrapper


我这样编辑.bashrc:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh


当我尝试运行“ source〜/ .bashrc”时,出现此错误:

/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.


我在以下目录中安装了pip,python和virtualenv:

which python
/usr/bin/python

which pip
/usr/bin/pip

which virtualenv
/usr/local/bin/virtualenv


我究竟做错了什么?

最佳答案

我想你需要

pip3 install virtualenv virtualenvwrapper


并将其添加到您的〜/ .bashrc文件中

 export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3


这是因为您的virtualenvwrapper指向python3。我现在解决了我的问题。感谢this help

关于python - Virtualenvwrapper:没有名为virtualenvwrapper的模块,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47458172/

10-12 18:15