# 1、安装包 $ pip3 install virtualenv virtualenvwrapper # 2、查找位置 $ sudo find / -name virtualenvwrapper.sh # 3、设置变量 $ sudo vim /etc/profile # 4、将下边两行加入到profile中 export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.sh # 5、重新加载配置 $ source /etc/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.
解决办法:
vim /usr/local/bin/virtualenvwrapper.sh 加入红色部位
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)