Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to upgrade python six package in mac osx 10.10.2

Tags:

I am trying to install latest version of six python package but I have following issues. Can't get rid of six 1.4.1 in mac OSX 10.10.2

sudo pip install six --upgrade Requirement already up-to-date: six in /Library/Python/2.7/site-packages Cleaning up...  pip search six six - Python 2 and 3 compatibility utilities INSTALLED: 1.9.0 (latest)  python -c "import six; print six.version" 1.4.1  which -a python /usr/bin/python which -a pip /usr/local/bin/pip 

What is wrong here? Can't upgrade six!

like image 442
Anish Avatar asked Apr 07 '15 07:04

Anish


People also ask

How do I upgrade to Python 6?

Type “ pip install six ” (without quotes) in the command line and hit Enter again. This installs six for your default Python installation. The previous command may not work if you have both Python versions 2 and 3 on your computer.

How do I upgrade a Python package to a specific version?

How do I Install a Specific Version of a Python Package? To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1.

How do I update my version of Python Mac?

Install Python 3 with the Official Installer First, download an installer package from the Python website. To do that, visit https://www.python.org/downloads/ on your Mac; it detects your operating system automatically and shows a big button for downloading the latest version of Python installer on your Mac.

How do I update pip packages?

To update installed packages to the latest version, run pip install with the --upgrade or -U option.


2 Answers

I resolved the problem by the following method.

  1. Download the six-1.10.0.tar.gz package
  2. Use this command to install it.

python setup.py install

This works because it installs the new version of six to /Library/Python/2.7/site-packages/ which is searched before /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/

like image 130
kellyxiepei Avatar answered Oct 08 '22 10:10

kellyxiepei


Your pip binary belongs to /usr/local/bin/python, whereas python points to /usr/bin/python. As a consequence

pip install --upgrade six 

will install to /usr/local/bin/python.

The command below will make sure that the right version of pip is used:

python -m pip install --upgrade six 
like image 42
cel Avatar answered Oct 08 '22 08:10

cel