After upgrading to OSX Mavericks, I am getting this message in the terminal:
/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 virtualenv has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
Re-arrange the export order so that the
python
path is placed before thevirtualenv
commands in your.bash_profile
file.Try edit .bash_profile file
Try reinstalling pip and then reinstalling virtualenvwrapper (I had to go through these steps after upgrading to Mavericks):
I wouldn't recommend running pip with sudo. This was my solution for the same problem (after upgrading to Mavericks).
In essence, uninstall any virtualenv and brewed Python you had before (use
which <command>
to check that you removed everything except the system Python in/usr/bin/python
) and cleanly install them once again:Running these two commands helped me get rid of it (had done a software update on macOS High Sierra)
pip install --upgrade virtualenvwrapper
will fix the issue but never usedsudo pip
this will change system-wide. If pip throws permission errors withoutsudo
then you should fix those and then try only withpip install <--upgrade> $(package)
.I rather suggest install
homebrew
and then installpip
usingbrew install pip
which will install latest stable version of pip for you.Install homebrew and then run
brew doctor
. If there are any warnings fix those(actually brew will tell you how to fixed those).You may need to remove system-wide python comes with Mac and use
brew
to install required versions. Use this to remove system-wide pythonbrew install python
or/andbrew install python3
to install required python version/s.Finaly run
pip install --upgrade virtualenvwrapper
Now on never use
sudo pip
only usepip
.