报错:/usr/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader'

原因:workon命令失效,Python的版本变更,先前是用的python3.6下安装的Python虚拟环境,相关的文件是在/Library/Frameworks/Python.framework/Versions/3.6/bin
解决方案1:重新在新的的python3.7环境下安装虚拟环境

$sudo pip3 install virtualenv virtualenvwrapper
$source .bashrc

解决方法2:将/Library/Frameworks/Python.framework/Versions/3.6/bin目录下的3个文件,拷贝到/usr/local/bin目录里


image.png
$cd /Library/Frameworks/Python.framework/Versions/3.6/bin
$cp virtualenv-clone virtualenvwrapper.sh virtualenvwrapper_lazy.sh /usr/local/bin

你可能感兴趣的:(报错:/usr/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader')