Python - can't update six, release uninstall previous version

When I ran sudo pip install --upgrade six , I ran into a problem below:

2016-01-20 18:29:48|optim $ sudo pip install --upgrade six Collecting six Downloading six-1.10.0-py2.py3-none-any.whl Installing collected packages: six Found existing installation: six 1.4.1 Detected a distutils installed project ('six') which we cannot uninstall. The metadata provided by distutils does not contain a list of files which have been installed, so pip does not know which files to uninstall.

I have Python 2.7, and I'm on Mac OS X 10.11.1.

How can I make this update successful?

(There are other related posts, but in fact they don’t have a solution to the same error.)

EDIT:

I was told that I can remove six manually by removing things from site-packages . These are the files in site-packages starting with six :

six-1.10.0.dist-info , six-1.9.0.dist-info , six.py , six.py

Are they all correct / safe to remove?

EDIT2:

I decided to remove those from site-packages , but it turns out that the existing six , which cannot be installed, is actually in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python .
There I see the files:
six-1.4.1-py2.7.egg-info , six.py , six.pyc but doing rm on them (with sudo , even) gives Operation not permitted . So now the question is how to delete these files, if any?

+5
source share
2 answers

Looks like a known bug in pip 8, which is now fixed (see Change 260150 )

Until this is resolved, you can proceed to clause 7.1.2

+4
source

I also had problems installing the modules, and sometimes I find that this helps just get started. In this case, it looks like you already have one of the β€œsix” modules, but it is not configured correctly, so if sudo pip removes six lessons the same way, go to your directory and manually delete everything related to six, and then try installing it. You may need to do digging where you have your modules stored (or saved since the pip can find them in different places).

+1
source

Source: https://habr.com/ru/post/1241093/


All Articles