virtualenvwrapper报错的解决办法

易小灯塔
2018-06-28 / 0 评论 / 6,469 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2023年10月08日,已超过415天没有更新,若内容或图片失效,请留言反馈。

virtualenvwrapper 没配置好, 发现会报如下错误

/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. 

解决的办法

编辑~/.bashrc文件的最下方加入下面语句:

if [ -f ~/.local/bin/virtualenvwrapper.sh ]; then
       export WORKON_HOME=$HOME/.virtualenvs
       export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
       source ~/.local/bin/virtualenvwrapper.sh
fi 

保存后更新配置即可解决问题

source ~/.bashrc 

image-20201107151425979

0

评论 (0)

取消