1

I can't upgrade pip (9.0.1) to pip (10.0.1).

Running

pip install --upgrade pip

throws

OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/EGG-INFO/PKG-INFO'

(this is yet another issue I will need to deal with...)

Trying

pip install --user pip

returns

Requirement already satisfied: pip in /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg

and has no effect, i.e. pip list | grep pip returns pip (9.0.1)

Running

pip install --upgrade --user pip

returns

Successfully installed pip-10.0.1

but pip list | grep pip still returns pip (9.0.1)

I have learned not to use sudo, so please don't suggest this.

This answer suggests to install by hand (more or less). But I am worried of messing things up.

If you are suggesting to use a virtual environment, I am afraid this is one level of sophistication too many for me as I am still very much a beginner, and if something doesn't work the way it should I will find it even more daunting to figure out what to try.

Is there really no alternative than the latter options?

dhilmathy
  • 2,800
  • 2
  • 21
  • 29
Antoine
  • 600
  • 7
  • 19
  • 1
    use sudo. for real. – SuperStew Jul 16 '18 at 14:21
  • you should really use virtualenvs, especially on a mac. you will find that takes way more expertise to do it without. for a mac user, i would also highly recommend to use pyenv. –  Jul 16 '18 at 14:24
  • @hop I have a rough understanding of what virtual environments are for, but I don't understand enough to see how using them will solve my problem. Anyway, need to do my homework before asking further questions... – Antoine Jul 16 '18 at 14:36
  • 1
    @Antoine: you're sytem is probably in state that would be very hard for us here to understand and debug. i'm marking this as off-topic, please don't take it personally. try asking on IRC (#python on freenode is usually quite helpful) or maybe at a local user group. for now, my best "guess" would be to clean up `/Library/Python/2.7/site-packages` (probably remove everythin there) and `~/.local/` by whatever means necessary and start over - at least with _always_ using `pip install --user`. –  Jul 16 '18 at 14:40
  • 1
    I'm voting to close this question as off-topic because it would probably need a longer back and forth to find out the state of the system. –  Jul 16 '18 at 14:40

1 Answers1

0

You can "safely" delete everyting in /Library/Python/2.7/site-packages/, except for:

$ cat Extras.pth 
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC

You can do it from the Finder (it should ask for your Admin credentials) or in a pinch with sudo rm - carful!

I'd recommend removing everything there - which should get rid of any packages you previously installed with pip or easy_install - and only ever using pip install --user from then on or better yet use pyenv from homebrew to get Python 3 and use virtual environments from then on.