Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install --upgrade setuptools #5329

Closed
johncornelius091 opened this issue Apr 25, 2018 · 13 comments
Closed

pip install --upgrade setuptools #5329

johncornelius091 opened this issue Apr 25, 2018 · 13 comments
Labels
OS: macos MacOS specific type: support User Support

Comments

@johncornelius091
Copy link

  • Pip version: 10.0.1
  • Python version: 2.7
  • Operating system: MacOS

Description:

I am trying to upgrade setuptools. but am stuck with an error.

What I've run:

pip install --upgrade setuptools

sh-3.2# pip install --upgrade setuptools
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/20/d7/04a0b689d3035143e2ff288f4b9ee4bf6ed80585cc121c90bfd85a1a8c2e/setuptools-39.0.1-py2.py3-none-any.whl
matplotlib 1.3.1 requires nose, which is not installed.
Installing collected packages: setuptools
Found existing installation: setuptools 18.5
Uninstalling setuptools-18.5:
Could not install packages due to an EnvironmentError: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/init.py', '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/init.py', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/init.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/init.pyc', '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/init.pyc', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/init.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2rF8Fc/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

Please let me know how to fix this.

@effusiveanam
Copy link

effusiveanam commented May 2, 2018

I am facing the same issue. Any solution to this??

@pradyunsg
Copy link
Member

You're trying to modify your OS-installed Python. Don't try that.

I suggest you get a separate Python installation (I do this) -- brew install python should suffice.

@pradyunsg pradyunsg added OS: macos MacOS specific type: support User Support labels May 6, 2018
@shihs
Copy link

shihs commented May 22, 2018

@pradyunsg
Thank you for your answer. I face the same problem too...

But I don't really understand what do you mean "separate Python installation"?
How do this "brew install python" suppose to run?

Thank you!

@nguyenkatie1
Copy link

I'm facing the same problem and was wondering if anyone figured out a fix?

Using also the following:
Pip version: 10.0.1
Python version: 2.7
Operating system: MacOS (Sierra)

@shihs

This comment has been minimized.

@pradyunsg
Copy link
Member

pradyunsg commented May 29, 2018

@shihs You shouldn't run pip with sudo. https://stackoverflow.com/questions/21055859/what-are-the-risks-of-running-sudo-pip

Homebrew is a tool to install developer tools on MacOS. Running brew install python in the terminal, after installing Homebrew, would install another Python which is not involved in the operating system's working. After that, pip should work as you expect it to.

@shihs
Copy link

shihs commented May 29, 2018

Hey @pradyunsg
THANK YOU SO MUCH! I understand now!

@NanheKumar
Copy link

Issue with scrapy installation i have resolved with bellow command.
Could not install packages due to an EnvironmentError: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/zope/init.py'

sudo pip install scrapy --upgrade --ignore-installed

@mentgmery
Copy link

@shihs @NanheKumar, it works, thanks.

@dbof10
Copy link

dbof10 commented Jul 18, 2019

Hello from 2019 guys

@jpic
Copy link

jpic commented Jul 18, 2019

@dbof10 the error message from the OS makes it pretty clear that there is a permission problem, i'm affraid further comments will dilute @pradyunsg's explanation into many more comments as such perhaps this issue should be closed / locked ?

@pfmoore
Copy link
Member

pfmoore commented Jul 18, 2019

Agreed. The root cause here is that you should never run pip as root (either directly or via sudo) as it will cause issues.

@pfmoore pfmoore closed this as completed Jul 18, 2019
@pradyunsg
Copy link
Member

pradyunsg commented Jul 18, 2019

Locking since I don't want to address this more times -- just, don't use pip with sudo or as root.

See #5329 (comment).

@pypa pypa locked as resolved and limited conversation to collaborators Jul 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
OS: macos MacOS specific type: support User Support
Projects
None yet
Development

No branches or pull requests

10 participants