参考:https://blog.csdn.net/heybob/article/details/82775257
在创建虚拟环境后,将python默认版本从2.7换为3.5后出现如下报错:
/usr/bin/python: Error while finding module specification for ‘virtualenvwrapper.hook_loader’ (ModuleNotFoundError: 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.
输入如下指令解决:
sudo pip3 install virtualenv virtualenvwrapper
source .bashrc
建议:将ubuntu默认python版本改为3.5后,在用virtualenv创建虚拟环境时指定Python版本。