I\'m trying to follow How To Serve Django Applications with uWSGI and Nginx on Ubuntu 14.04 and I\'m failing at the very earlier stage, due to amount of output, I placed all
This error appeared for me after running brew update and brew upgrade on mac os high sierra.
The issue was resolved by reinstalling virtualenvwrappper i.e. pip install virtualenvwrapper.
I had a similar issue on Mac OS Catalina 10.15.6 after I installed vim and macvim
using following:
brew install vim && brew install macvim
which I believe was the cause for the problem.
While workon worked but always gave an error message as below:
~ $ workon loom
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper')
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper')
(loom) ~ $
What worked for me finally was:
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3 to .bash_profilesudo pip3 install virtualenvwrapperI encountered a similar issue with virtualenvwrapper complaining not being to find virtualenvwrapper.hook_loader. I was able to narrow down to this particular line in my .bash_profile
source /usr/local/bin/virtualenvwrapper.sh
as seen below
$ source /usr/local/bin/virtualenvwrapper.sh
/usr/local/opt/python3/bin/python3.6: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: 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/local/bin/python3 and that PATH is
set properly.
After some trial and error, it turns out that a reinstallation of the virtualenvwrapper package resolved it. This was a manifest of the fact that I recently upgrade python3 (from version 3.5.2 to 3.6.1) via homebrew and in turn it broke virtualenvwrapper's shell script that hardcoded references to the older version of python3 (in my case it was 3.5.2). In short, this below line should fix it (at least in my case it did).
pip3 install virtualenvwrapper
In macOS Sierra,
If you installed virtualenv package using pip3,
add following to .bash_profile
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
or
export VIRTUALENVWRAPPER_PYTHON=$(which python3)
after that every new virtualenvironment you created using workon myvenv
uses python3 as python interpreter
I had already installed virtualenv so just needed to run
pip3 install virtualenvwrapper
In my case, there was somehow a mismatch between pip3 and python3 (because I have multiple pythons installed). This worked for me:
sudo python -m pip install virtualenvwrapper