16

I've just installed virtualenv (with Python 2.7.2) on my Mac, and I followed the guide here: http://virtualenvwrapper.readthedocs.org/en/latest/install.html

But I now get the following errors when I start up my shell every time:

stevedore.extension Could not load 'user_scripts': distribute
stevedore.extension distribute
Traceback (most recent call last):
 File "/Library/Python/2.7/site-packages/stevedore/extension.py", line 62, in __init__
 invoke_kwds,
 File "/Library/Python/2.7/site-packages/stevedore/extension.py", line 74, in _load_one_plugin
 plugin = ep.load()
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1953, in load
 if require: self.require(env, installer)
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1966, in require
 working_set.resolve(self.dist.requires(self.extras),env,installer))
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 565, in resolve
 raise DistributionNotFound(req) # XXX put more info here
DistributionNotFound: distribute
stevedore.extension Could not load 'project': distribute
stevedore.extension distribute
Traceback (most recent call last):
 File "/Library/Python/2.7/site-packages/stevedore/extension.py", line 62, in __init__
 invoke_kwds,
 File "/Library/Python/2.7/site-packages/stevedore/extension.py", line 74, in _load_one_plugin
 plugin = ep.load()
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1953, in load
 if require: self.require(env, installer)
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1966, in require
 working_set.resolve(self.dist.requires(self.extras),env,installer))
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 565, in resolve
 raise DistributionNotFound(req) # XXX put more info here
DistributionNotFound: distribute
stevedore.extension Could not load 'user_scripts': distribute
stevedore.extension distribute
Traceback (most recent call last):
 File "/Library/Python/2.7/site-packages/stevedore/extension.py", line 62, in __init__
 invoke_kwds,
 File "/Library/Python/2.7/site-packages/stevedore/extension.py", line 74, in _load_one_plugin
 plugin = ep.load()
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1953, in load
 if require: self.require(env, installer)
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1966, in require
 working_set.resolve(self.dist.requires(self.extras),env,installer))
 File "/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 565, in resolve
 raise DistributionNotFound(req) # XXX put more info here
DistributionNotFound: distribute

I don't know if it is affecting this problem, but I am using ZSH.

I tried to install stevedore through pip (sudo pip install stevedore), but I get the following error:

sudo sh setuptools-0.6c11-py2.7.egg
Processing setuptools-0.6c11-py2.7.egg
removing '/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg' (and everything under it)
Copying setuptools-0.6c11-py2.7.egg to /Library/Python/2.7/site-packages
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
TXSLs-MacBook-Pro% sudo pip install stevedore --upgrade
Requirement already up-to-date: stevedore in /Library/Python/2.7/site-packages
Downloading/unpacking distribute (from stevedore)
 Running setup.py egg_info for package distribute
Installing collected packages: distribute
 Running setup.py install for distribute
 Before install bootstrap.
 Scanning installed packages
 Setuptools installation detected at /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
 Egg installation
 Patching...
 Renaming /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1348764450.4
 Patched done.
 Relaunching...
 Traceback (most recent call last):
 File "<string>", line 1, in <module>
 NameError: name 'install' is not defined
 Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-FAPgYH-record/install-record.txt --single-version-externally-managed:
 Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
Egg installation
Patching...
Renaming /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1348764450.4
Patched done.
Relaunching...
Traceback (most recent call last):
 File "<string>", line 1, in <module>
NameError: name 'install' is not defined
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-FAPgYH-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/distribute
Storing complete log in /Users/txsl/Library/Logs/pip.log

I manually installed setuptools as I couldn't install anything through pip without it.

What has gone wrong here and how can i fix it? The internet doesn't seem to have many cases of the error with stevedore. I feel rather stuck at the moment!

Many thanks!

asked Sep 27, 2012 at 16:52

4 Answers 4

20

I also use zsh and had a similar problem. I solved with this:

sudo pip install virtualenv virtualenvwrapper

I have the package python-pip installed in my Ubuntu 12.04.

answered Dec 4, 2012 at 12:31
Sign up to request clarification or add additional context in comments.

3 Comments

Yup, that worked! In my case, I use homebrew to upgrade python 2.7.3 to python 2.7.5. The previous virtual environment that was created in python 2.7.3 will have this same problem. The key is to deactivate that virtual environment and then upgrade virtualenv + virtualenvwrapper for the system-wide python, which is exactly what Marcos suggested above. Works like a charm! I used: sudo pip install --upgrade virtualenv virtualenvwrapper
pip install --upgrade virtualenv virtualenvwrapper (note the --upgrade) worked for me after upgrading to Mavericks and then upgrading Python via Homebrew.
this worked for me in after upgrading to Ubuntu 14.04
17

Based on the error you are getting, it looks like you are having the following error: install glitch when using pip + virtualenv.

The issue is created when using the -distribute switch. The fix is (without re-running virtualenv with --distribute):

source bin/activate
wget http://python-distribute.org/distribute_setup.py
python distribute_setup.py
answered Sep 27, 2012 at 17:16

12 Comments

I get stuck at the first line! : source bin/activate source: no such file or directory: bin/activate
To execute that line you need to make sure that you have changed directories into wherever you created your virtualenv. So if you created a virtualenv called vetest in your user profile you would need to type the following before executing that command: cd ~/vetest then you would type... source bin/activate
Wait so do I need to do this for every virtualenv i create? I haven't actually set any up yet.
Well the answer is two fold. You could uninstall and reinstall without the --distribute option. Or you have to do this every time.
Cool. Sorry to be useless, but would you mind taking me through uninstalling it? I'm not very confident with this! I would much rather reinstall than have to do that every time!!
|
7

Had the same error message, upgrading the setuptools resolved the issue for me.

pip install --upgrade setuptools

I've found the information in this thread: http://blog.gmane.org/gmane.comp.python.virtualenv/month=20131001

answered Jan 25, 2014 at 17:17

1 Comment

Worked for me. I did sudo pip install --upgrade setuptools, then sudo uninstall virtualenv and sudo uninstall virtualenvwrapper, then reinstalled them with sudo pip install virtualenv virtualenvwrapper. Worked like a charm after that.
4

I had the same problem after upgrading to OSX Mavericks. I fixed it by installing distribute globally.

sudo pip install distribute

I deactivated my current virtualenv first.

answered Jan 25, 2014 at 18:05

1 Comment

This also fixed it for me on Mavericks.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.