virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not imp

Linux(ubuntu)上python2与python3共存环境下,安装virtualenvwrapper后, 其环境变量被自动设置为VIRTUALENVWRAPPER_PYTHON=/usr/bin/python

该地址指向Python2的解释器,现在更改成Python3就可以了,具体操作如下:

# 修改环境变量,重新载入
vim ~/.bashrc

在.bashrc文件中,删除原先的virtualenvwrapper配置,并追加以下内容

virtualenvwrapper.sh: There was a problem running the initialization hooks.  If Python could not imp

if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
    export WORKON_HOME=$HOME/.virtualenvs
    export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
    source /usr/local/bin/virtualenvwrapper.sh
fi

重新载入.bashrc

source ~/.bashrc

 

成功!

virtualenvwrapper.sh: There was a problem running the initialization hooks.  If Python could not imp

 

上一篇:P4178 Tree(点分治+树状数组/容斥)


下一篇:P4323-[JSOI2016]独特的树叶【换根dp,树哈希】