Skip to content

pip install --upgrade setuptools #5329

Closed
@johncornelius091

Description

@johncornelius091
  • 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.

Activity

effusiveanam

effusiveanam commented on May 2, 2018

@effusiveanam

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

pradyunsg

pradyunsg commented on May 6, 2018

@pradyunsg
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.

shihs

shihs commented on May 22, 2018

@shihs

@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

nguyenkatie1 commented on May 28, 2018

@nguyenkatie1

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

shihs commented on May 29, 2018

@shihs
pradyunsg

pradyunsg commented on May 29, 2018

@pradyunsg
Member

@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

shihs commented on May 29, 2018

@shihs

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

NanheKumar

NanheKumar commented on Nov 20, 2018

@NanheKumar

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

mentgmery commented on Feb 18, 2019

@mentgmery

@shihs @NanheKumar, it works, thanks.

dbof10

dbof10 commented on Jul 18, 2019

@dbof10

Hello from 2019 guys

jpic

jpic commented on Jul 18, 2019

@jpic

@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

pfmoore commented on Jul 18, 2019

@pfmoore
Member

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

pradyunsg

pradyunsg commented on Jul 18, 2019

@pradyunsg
Member

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

See #5329 (comment).

locked as resolved and limited conversation to collaborators on Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jpic@pfmoore@johncornelius091@pradyunsg@mentgmery

        Issue actions

          pip install --upgrade setuptools · Issue #5329 · pypa/pip