4

I have found several pip problems on stack overflow, but unfortunately it seems like I am experiencing some that I can't find. Particularly I am getting following error message whenever I try to use pip:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 9, in <module>
load_entry_point('pip==1.3.1', 'console_scripts', 'pip')()
 File "build/bdist.macosx-10.5-intel/egg/pkg_resources.py", line 357, in load_entry_point
"""Yield named metadata resource as list of non-blank non-comment lines
 File "build/bdist.macosx-10.5-intel/egg/pkg_resources.py", line 2394, in load_entry_point
except ValueError:
File "build/bdist.macosx-10.5-intel/egg/pkg_resources.py", line 2108, in load

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/__init__.py", line 10, in <module>
from pip.backwardcompat import u, walk_packages, console_to_str
ImportError: cannot import name walk_packages

Does anyone have any idea what can be wrong? Until now I have tried to reinstall pip as it was recommended here: Python mechanize module not found and I have also tried this Pip using system python osx, but non of them works for me.

Thank you in advance for any advices.

Community
  • 1
  • 1
ziky90
  • 2,347
  • 4
  • 27
  • 46
  • I think you're a victim of having tried different installations, and now you run into left-overs hanging around from different versions. pip 1.3 doesn't not have a `walk_packages` anymore, from what I can see in my installation. –  Sep 10 '13 at 12:11
  • For a quick guess, nuke the `pip` directory in `/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip` and the executable itself, `/Library/Frameworks/Python.framework/Versions/2.7/bin/pip`. Then, *using the Python that belongs to the version you installed yourself* (guessing this from version numbers and paths), install pip (yet) again. This all assumes you're comfortable with the terminal, command line and sudo. –  Sep 10 '13 at 12:13
  • I have just one version of Python (or at least it seems to me like that), but it seems that I have several versions of pip. I'll just add that I started to have this problem after I've installed scipy, numpy and matplotlib. Some of them was impossible to install using pip so I've tried stuff like pypm or homebrew. At the end I've installed all the libraries successfully, but somehow destroyed pip installation. – ziky90 Sep 10 '13 at 13:59
  • If you got homebrew, try the homebrewed pip and see what that gives you. In fact, I would just install and use a homebrewed Python as well (though yes, you may need to reinstall scipy/numpy/mpl again then). –  Sep 10 '13 at 14:08
  • I mentioned the Python versions, since OS x 10.5 comes with Python 2.5. It appears you have upgraded the system Python (i.e., installed another version *over* it). And now it looks like an older pip left some old files behind (that's why I suggest removing the pip package), which clash with the new version of pip (that doesn't use them anymore). –  Sep 10 '13 at 14:10
  • So now I've somehow repaired pip by sudo easy_install -U pip command. Anyway thank you for advices and I've to do something with my python installations. I'll try to remove the old pip anyway. – ziky90 Sep 10 '13 at 15:09

1 Answers1

9

Somehow solved by command sudo easy_install -U pip

ziky90
  • 2,347
  • 4
  • 27
  • 46