Virtualenvwrapper:没有名为virtualenvwrapp的模块

2024-06-20 15:18:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我想让VirtualVwrapper运行起来。 我安装它时:

sudo pip install virtualenvwrapper

我把.bashrc编辑成这样:

^{pr2}$

当我尝试运行“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

我做错什么了?在


Tags: installpipthe编辑whichbinthatvirtualenv
3条回答

之所以会出现错误,是因为您为Python2.7安装了virtualenv,但您尝试在Python3中使用它。使用pip3在多版本系统上安装python3包。在

pip uninstall virtualenvwrapper
pip3 install virtualenv virtualenvwrapper

您需要在您的.bashrcsource /usr/local/bin/virtualenvwrapper.sh(不需要导出它)。在

我觉得你需要

pip3 install virtualenv virtualenvwrapper

并将其添加到~/.bashrc文件中

^{pr2}$

这是因为你的虚拟说唱歌手指的是Python3。我刚刚解决了我的问题。感谢this help

相关问题 更多 >