ubuntu下,py2,py3共存python
運行virtualenvwrapper會報錯以下:ubuntu
/usr/bin/python: No module named virtualenvwrapperbash
個人virtualenvwrapper實際上安裝在python3下,python2下沒有裝。app
可是virtualenvwrapper的腳本仍是默認使用的/usr/bin/python,咱們須要把他修改默認成/usr/bin/python3.
修改步驟,在~/.bashrc文件中,在source /usr/local/bin/virtualenvwrapper.sh前,加入:code
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
也就是關於virtualenvwrapper.sh這段,修改爲:module
if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.sh fi