2

Running yolk -U recently I noticed that pip needed upgrading from 1.2.1 to 1.4.1 and dutifully attempted to upgrade it with

pip install --upgrade pip

Though running yolk -U again appeared to confirm a successful upgrade (pip is no longer listed as being out of date), this generated an error message

Downloading/unpacking pip from https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz#md5=6afbb46aeb48abac658d4df742bff714
Downloading pip-1.4.1.tar.gz (445kB): 445kB downloaded
Running setup.py egg_info for package pip

  warning: no files found matching '*.html' under directory 'docs'
  warning: no previously-included files matching '*.rst' found under directory 'docs/_build'
  no previously-included directories found matching 'docs/_build/_sources'
Installing collected packages: pip
  Found existing installation: pip 1.2.1
  Uninstalling pip:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 261, in run
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1162, in install
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 495, in uninstall
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1492, in remove
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/util.py", line 273, in renames
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/bin/pip'

And on all my subsequent attempts to use pip do as well:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    continue    # try the next older version of project
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve

pkg_resources.DistributionNotFound: pip==1.2.1

I see that similar problems have been reported before, but none of the suggestions I see help resolve this.

I'm stuck, and can't maintain my Python installation.


I'm using OS 10.8.4, Python 2.7.2 in /usr/bin/python.

Community
  • 1
  • 1
orome
  • 45,163
  • 57
  • 202
  • 418

1 Answers1

6

According to this line:

OSError: [Errno 13] Permission denied: '/usr/local/bin/pip'

It seems like a *nix permission issue, try to launch the upgrade using sudo:

sudo pip install --upgrade pip

On a side note, I'd recommend using this upgrade method: http://www.pip-installer.org/en/latest/installing.html#install-or-upgrade-pip

tl;dr version (thanks to the information given by OP ;)):

1.Download and laucnh get-pip.py from http://www.pip-installer.org/en/latest/installing.html#install-or-upgrade-pip

2.If you get an error about "invalid command 'egg_info'", you'll need to upgrade setup tools using pip install --upgrade setuptools or easy_install -U

Ketouem
  • 3,820
  • 1
  • 19
  • 29
  • Success! `sudo pip` fails too (`pip` appears to be absent after my failed upgrade) but the linked approach was a success. If you rewrite to emphasize that (and perhaps there's something in my error output that confirms that my old `pip` was removed?) and I'll accept. Thanks! – orome Sep 02 '13 at 20:04
  • Note that after doing this I got "invalid command 'egg_info'" errors, which needed [an additional step](http://stackoverflow.com/a/11425830/656912) to fix. – orome Sep 02 '13 at 20:21