gpt4 book ai didi

python - Virtualenvwrapper:没有名为 virtualenvwrapper 的模块

转载 作者:太空宇宙 更新时间:2023-11-04 08:37:51 25 4
gpt4 key购买 nike

我正在尝试运行 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com