3

I am trying to install Python Goose on my Mac (I'm running OSX 10.9.3). The first step in installing Goose is:

mkvirtualenv --no-site-packages goose

However when I run this command I get the following error message:

ERROR: virtualenvwrapper could not find virtualenv in your path

I researched this on the http://virtualenvwrapper.readthedocs.org/en/latest/install.html page and added the following three lines to my bash_profile:

export WORKON_HOME=$HOME/.virtualenvs

export PROJECT_HOME=$HOME/Devel

source /usr/local/bin/virtualenvwrapper.sh

After editing bash_profile I reloaded the startup file with the following:

source ~/.bash_profile

However I got the following error message:

Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "build/bdist.macosx-10.9-intel/egg/virtualenvwrapper/hook_loader.py", line 16, in ImportError: No module named stevedore 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/bin/python and that PATH is set properly.

At this point I'm not sure what to do, If anybody has any ideas on how to proceed I would appreciate the help. Thanks, George

5 Answers 5

7

I had some similar errors, but it was because I installed virtualenv with pip --user virtualenv and had export PATH="$PATH:~/Library/Python/2.7/bin". Something failed to evaluate ~/, and replacing it with $HOME fixed things.

2
  • This one happened to me and I was scratching my head for days. Your post, therefore, was extremely useful. After solving it, having a look at the rules for tilde expansion made everything clear.
    – c-garcia
    Commented Sep 26, 2015 at 8:11
  • One of the projects we did in my operating systems class was writing a *nix shell. It made a lot of the absurd things you see in shell scripting make a lot more sense. Commented Sep 26, 2015 at 20:08
6

The ERROR: virtualenvwrapper could not find virtualenv in your path has nothing to do with anything but SYSTEM PATH.

so what you need to do is find where your virtualenv is installed in my case it's here ~/.local/bin/virtualenv because I installed it with pip so all you have to do is find the bin folder where virtualenv is installed and add that PATH to your system path variable. Adding something like export PATH=$PATH:$HOME/.local/bin in your .bashrc or .bash_profile should do.

Than all you need is make your shell invoke the fresh changes. source ~/.bashrc or source ~/.bash_profile.

0

I discovered why I was unable to get virtualenv to work. I originally installed virtualenv using easy_install. I'm not sure why but easy_install does not properly install virtualenv. I then reinstalled virtualenv using pip. The pip install was successful and I am now able to run the mkvirtualenv --no-site-packages goose command successfully. Thanks, George

0

For me it was because my python was in a different location

so first go

~ » which python /usr/bin/python

then put that path in our .bachrc using this export e.g

export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python

-3

In my case I didn't have which installed. Once I installed which it worked.

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