Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - Cannot upgrade six, issue uninstalling previous version [duplicate]

When I run sudo pip install --upgrade six I run into the issue 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 upgrade successful?

(There are other kind of related posts, but they do not actually have a solution to this same error.)

EDIT:

I am told I can remove six manually by removing things from site-packages. These are the files in site-packages that begin 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 the existing six that 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 can I remove those files, given where they are?

like image 761
tscizzle Avatar asked Jan 20 '16 23:01

tscizzle


2 Answers

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

Until this is resolved you can downgrade to pip 7.1.2

like image 92
Amos Avatar answered Oct 18 '22 22:10

Amos


I, too, have had some issues with installing modules, and I sometimes find that it helps just to start over. In this case, it looks like you already have some of the 'six' module, but isn't properly set up, so if sudo pip uninstall six yields the same thing, go into your directory and manually delete anything related to six, and then try installing it. You may have to do some digging where you have your modules are stored (or have been stored, as pip can find them in different locations).

like image 1
MANA624 Avatar answered Oct 18 '22 22:10

MANA624