Reputation: 53
I'm trying to get virtualenvwrapper running. I install it with:
sudo pip install virtualenvwrapper
I edited the .bashrc like this:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh
When I try to run "source ~/.bashrc" I get this error:
/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.
I installed pip, python and virtualenv in the following directories:
which python
/usr/bin/python
which pip
/usr/bin/pip
which virtualenv
/usr/local/bin/virtualenv
What am I doing wrong?
Upvotes: 2
Views: 4561
Reputation: 170
I think you need to
pip3 install virtualenv virtualenvwrapper
and add this to your ~/.bashrc file
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
This is because your virtualenvwrapper is pointing to python3. I just resolved mine now. Thanks to this help
Upvotes: 5
Reputation: 27311
You need to source /usr/local/bin/virtualenvwrapper.sh
in your .bashrc
(you don't need to export it).
Upvotes: 1
Reputation: 11280
Your error happens because you installed virtualenv for Python 2.7, but you try use it with Python 3. Use pip3 to install Python 3 packages on multi-version system.
pip uninstall virtualenvwrapper
pip3 install virtualenv virtualenvwrapper
Upvotes: 1