virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper.........(解决办法)

Linux (ubuntu) on python2 python3 coexist with environment, virtualenvwrapper after installation, the environmental variable is automatically set to VIRTUALENVWRAPPER_PYTHON = / usr / bin / python

The address points Python2 interpreter, is now changed to Python3 on it, as follows:

# Modify environment variables, reload 
vim ~ / .bashrc

In .bashrc file, delete the original virtualenvwrapper configuration, and append the following

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

Reloading .bashrc

source ~/.bashrc

 

success!

 

Guess you like

Origin www.cnblogs.com/kisun168/p/10960886.html