标签:imp 路径 and HERE ali lin app 安装 pat
我在使用mac安装virtualwrapper的时候遇到了问题,搞了好长时间,才弄好,在这里总结一下分享出来,供遇到相同的问题的朋友使用,少走些弯路。
Mac默认系统的python2,而我自己用的是brew安装的python3
下面是我安装过程中出现的问题
pip3 install virtualenv
pip3 install virtualenvwrapper
# Settings for virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
source ~/.bash_profile
这时,出现了如下问题:
/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.
从报错信息VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is set properly.
这一句话来看,是环境指向python2
的路径,所以我们只需要将这个环境变量修改为python3
的路径即可。
vim ~/.bash_profile
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
source ~/.bash_profile
Mac安装virtualwrapper时报错No module named virtualenvwrapper
标签:imp 路径 and HERE ali lin app 安装 pat
原文地址:https://www.cnblogs.com/DeaconOne/p/10822790.html