2
votes

I'm trying to setup virtualenv & virtualenvwrapper on my mac but am experiencing problems with virtualenvwrapper.

I've looked through the other related posts regarding this and tried some things but I still get an error when my .bash_profile loads on the line

source /usr/local/bin/virtualenvwrapper.sh

error msg: File "", line 1, in File "/Library/Python/2.7/site-packages/virtualenvwrapper/hook_loader.py", line 16, in import pkg_resources ImportError: No module named pkg_resources*

'which python' yields '/usr/local/bin/python'

and running IDLE tells me its using v2.7.3

I've previously run

pip install virtualenv

and

pip install virtualenvwrapper

and they both appeared to run through fine.

Running a 'find' shows that pkg_resources.py is in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py

my PATH is /usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin

also cat .bash_profile yields

export WORKON_HOME=$HOME/workspace/virtualenvs
export PROJECT_HOME=$HOME/workspace/repos
export PATH=/usr/local/python:$PATH
source /usr/local/bin/virtualenvwrapper.sh

Anyone else had this problem and found a fix?

many thanks

1
You say that your python is in /usr/local/bin. How did you install it? (Python.app/homebrew/macports...)semisight
pretty sure its just the pre installed python on the Macjacanterbury

1 Answers

0
votes

I had the same error this morning. Upgrading setuptools on my base python environment (not inside a virtual environment) fixed this issue. Here is the command I ran

sudo pip install setuptools --upgrade

I had setuptools installed before, but maybe I had a bad version or a corrupted install. Upgrading with --upgrade fixed it.