Lots of other threads about similar issues, but none that I could find where quite the same case as mine. So, here goes:
Things I did:
- Ran:
sudo easy_install pip
- Ran:
sudo pip install virtualenv
- Ran:
sudo pip install virtualenvwrapper
Current State:
.bash_profile
export PATH=/usr/local/bin:$PATH export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache export WORKON_HOME=$HOME/.virtualenvs export PIP_VIRTUALENV_BASE=$WORKON_HOME export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python
Running
mkvirtualenv test
results in:New python executable in trunk/bin/python Installing setuptools, pip...done. /usr/bin/python: No module named virtualenvwrapper
Manually inspecting '/usr/local/bin' shows that virtualenvwrapper.sh exists
- Unlike some other questions I saw about this, I get no message about virtualenvwrapper when I start a new terminal window
- Running 'which python' results in:
/usr/bin/python
What I've tried:
- Inspecting my path to make sure it looks like it is supposed to
- Reinstalling pip, then using the reinstalled pip to reinstall virtualenv and virtualenvwrapper
Any help getting this working would be very much appreciated.
try installing virtualenv and virtualenvwrapper with
pip2 install virtualenv virtualenvwrapper
. it seems like pip install virtualenv and it's wrapper to python 3 as it's defaultI don't know if it's relevant to anyone but I got this error while editing
~/.zshrc
while virtualenv being active. So I had todeactivate
and thenrmvirtualenv env_name
to remove the errors. And then I recreated the env:mkvirtaulenv env_name
andworkon env_name
and this time I got no errors.Hope it helps someone.
Try to uninstall your
virtualenv
andvirtualenvwrapper
and install it again usingpip
(check if you symlink your pip or assigned an alias on it for other version) in version 2.7 (I think).I encountered the same error and I just did this and solved my problem.
I using Ubuntu machine.
I hope this help.
If you take a look at the virtualenvwrapper.sh script, you will find these lines:
If you don't manually export
VIRTUALENVWRAPPER
appropriately for your version of python, it will assume the system default where you don't have the virtualenvwrapper package installed.I fixed this like so:
This is all documented on the official website here.
I had the same problem setting up virtualenvwrapper on ubuntu.
I had installed virtualenv, virtualenvwrapper using pip which installed these modules in the site package of python3.5. How did I find that out?
Open your terminal and type
pip 9.0.1 from /home/clyton/.virtualenvs/test1/lib/python3.5/site-packages (python 3.5)
Then I checked the variable
VIRTUALENVWRAPPER_PYTHON
whose value was /usr/bin/python. On your terminal and typeAs you can see this variable is pointing to python2.7 and you may have installed virtualenv in a different python site package.
So to fix this problem, just add the below line in your bashrc
NOTE: Set the above value to the python version with which virtualenv was installed. In my case it was python3.5 so I have set that value. How to find out the python version used to install virtualenv? Again type
pip --version
in the terminal.Then open a new shell session and try mkvirtualenv again. This time it should work.
In my case, adding this line into my .zshrc file did the trick,
remember to source ~/.zshrc to update the change to your current terminal.