虚拟环境错误:启动bash 时候出现/usr/bin/python: No module named virtualenvwrapper
背景
- 系统:Ubuntu 18
- 错误
/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.
解决办法
- 原因
环境变量没有配置
- 解决
在终端中加入环境变量配置
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv