2

I try to upgrade(or uninstall) setuptools:

pip install setuptools --upgrade

but I got an error like this

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/req/req_set.py", line 726, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/req/req_install.py", line 746, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
    copytree(src, real_dst, symlinks=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/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/__init__.pyc', '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/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/markers.py', '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/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/markers.pyc', '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/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', '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/var/folders/0j/w8zdr8_d3090z1r38l11v0r00000gn/T/pip-0H2uCV-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

When I use command

sudo pip install setuptools --no-use-wheel --upgrade

according to

Upgrading setuptools on OSX El Capitan

Though there is no error, the setuptools does not upgrade actually.

How can I upgrade or even uninstall the setuptools?

Community
  • 1
  • 1
winterszhang
  • 111
  • 1
  • 6
  • 2
    You should not be trying to manage the OS-installed Python libraries with `pip`. Create a virtual environment or similar, where you can install whichever version you like of every library you need without mucking with the files the system is depending on. – tripleee Mar 14 '16 at 12:47

0 Answers0