Description
- 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 commentedon May 2, 2018
I am facing the same issue. Any solution to this??
pradyunsg commentedon May 6, 2018
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 commentedon 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 commentedon May 28, 2018
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 commentedon May 29, 2018
pradyunsg commentedon 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 commentedon May 29, 2018
Hey @pradyunsg
THANK YOU SO MUCH! I understand now!
NanheKumar commentedon Nov 20, 2018
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 commentedon Feb 18, 2019
@shihs @NanheKumar, it works, thanks.
dbof10 commentedon Jul 18, 2019
Hello from 2019 guys
jpic commentedon 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 commentedon 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.
pradyunsg commentedon 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).