2
votes

I'm getting the following error when trying to set up a new virtualenv with python3.4 (I'm running this command: virtualenv –p /usr/bin/python /tmp/djangodev):

Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-     packages/pkg_resources.py", line 2697, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 669, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 576, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (virtualenv 1.11.6 (/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages),     
Requirement.parse('virtualenv==1.7.2'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2701, in <module>
parse_requirements(__requires__), Environment()
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 572, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: virtualenv==1.7.2

I first downloaded virtualenv1.7.2 and after getting this error updated it by running: pip install virtualenv. Here is the successful installation message from this:

Downloading/unpacking virtualenv
Downloading virtualenv-1.11.6-py2.py3-none-any.whl (1.6MB): 1.6MB downloaded
Installing collected packages: virtualenv
Successfully installed virtualenv
Cleaning up...

Can someone please help me resolve the above error?

1
It looks like you have a couple of different versions of Python, and possibly virtualenv, installed. What does which -a virtualenv return?MattDMo
which -a virtualenv returned: /System/Library/Frameworks/Python.framework/Versions/3.4/bin/virtualenv -and- /usr/local/bin/virtualenvalphathesis

1 Answers

2
votes

Thanks @MattDMo for cluing me in.

I indeed have multiple virtualenvs installed so I ran sudo pip uninstall virtualenv and then sudo pip install virtualenv and this resolved the above error.