0

I seem to have broken virtualenvwrapper while trying to upgrade Python 3 from 3.4.1 to the current version. Whenever I run "workon xxx", I get the following error:

usr/local/opt/python3/bin/python3.4: Error while finding spec for 'virtualenvwrapper.hook_loader' (<class 'ImportError'>: No module named 'virtualenvwrapper')

Background:

I have Python 2.7.6 and 3.4.1 installed on my Mac workstation (OSX 10.8.5). I also have virtualenvwrapper running with many different environments - some using 2.7 and other 3.4. Virtualenvwrapper was installed under 3.4.

I just attempted to upgrade Python 3.4.1 to the latest version by running "brew install python3". This installed 3.4.2, but failed to fully complete, saying it was unable to create a few necessary symlinks, and to run "brew link --overwrite python3", which I did.

Any guidance is greatly appreciated. Thanks.

1 Answer 1

1

I think I fixed it, but it would be great to get some feedback / confirmation.

From the error message, I am guessing that the Python3 virtualenvwrapper module had gotten blown away (or symlinked away). I found that pip can be forced to run from to run from a particular Python version using the syntax: pipV.V <command>. That is, to run pip against Python 3.4: $ pip3.4 freeze, for example.

Pip complained about being out of date, so here's all the steps I took to seemingly repair the problem: $ sudo pip3.4 install --upgrade pip $ pip3.4 freeze (returned nothing, and pip no longer complained about being out of date) $ sudo pip3.4 install virtualenvwrapper

Now "workon xxx" no longer complains, and appears to be functioning properly...

Not the answer you're looking for? Browse other questions tagged or ask your own question.