4

I recently upgrading to Mountain Lion, and most of my Python tools got messed up. I downloaded the new version of XCode and downloaded the command-line tools. Python itself works fine - that is, I can open up python (2.7) from the command line and use it.

When I try to do anything else, I get

ImportError: No module named pkg_resources.

Example, when using mercurial:

Traceback (most recent call last):
  File "/usr/local/bin/hg", line 4, in <module>
    import pkg_resources
ImportError: No module named pkg_resources

I read on this page: No module named pkg_resources that this can be fixed by reinstalling setuptools, so I tried to follow the directions at http://pypi.python.org/pypi/setuptools#id4. I downloaded setuptools-0.6c11-py2.7.egg, did "sudo sh setuptools-0.6c11-py2.7.egg" and got no errors.

I re-installed mercurial using easy_install, but now something else is wrong and I get the same message as above when I try to use easy_install.

Traceback (most recent call last):
  File "/usr/bin/easy_install-2.7", line 7, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

I know this question has been answered before but none of the solutions seem to work for me. If there is anything else I can provide to help answer this problem, I am happy to do so. I bet it is some simple problem with my path, or conflicting versions, or something? I'd just really like to get mercurial up and running again. Thanks.

Community
  • 1
  • 1
user1922278
  • 41
  • 1
  • 3

1 Answers1

0

Ive never used that sudo sh method you mentioned. Have you tried doing this?

https://pypi.python.org/pypi/setuptools#unix-based-systems-including-mac-os-x

It is similar to what is mentioned in the link that solves the issue, which is basically the run setuptools' ez_setup.py script.