What does "error: option --single-version-externally-managed not recognized" indicate?

PythonPipDistribute

Python Problem Overview


I seem to have suddenly started to encounter the error error: option --single-version-externally-managed not recognized when using pip install with various packages (including PyObjC and astropy).

I've never seen this error before, but it's now also showing up on travis-ci builds for which nothing has changed.

Does this error indicate an out of date distribution?

Some incorrectly specified option in setup.py?

Something else entirely?

Python Solutions


Solution 1 - Python

Add --egg option

pip install --egg SCons

I use pip version 1.4.1

Solution 2 - Python

New Update:

Install the latest version of setuptools. If you still get the error, install wheel as well.

pip install -U setuptools
pip install -U wheel

Original Answer / More Details:

--single-version-externally-managed is an option used for Python packages instructing the setuptools module to create a Python package which can be easily managed by the host's package manager if needed, like Yum or Apt.

If you're seeing this message, you may have an old version of setuptools or Python. Try using Distribute, which is a newer version of setuptools and is backwards compatible. These packages may expect that you have it already.

https://pypi.python.org/pypi/distribute

Edit: At this point, distribute has been merged into the main setuptools project. Just install the latest version of setuptools. As @wynemo indicated, you may wish to use the --egg option instead, as it's more appropriate for those doing manual installations where you're not intending to create a system package for distribution.

Solution 3 - Python

Installing wheel resolved this issue with recent pip (I used 8.1.2):

pip install wheel

Solution 4 - Python

Try upgrading setuptools like this:

pip install --upgrade setuptools

Solution 5 - Python

I was having this problem. It turned out it was a problem with the file permissions on my pip cache.

If you see a message at the very beginning of your pip output like

The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

you might have the same problem. You can resolve it by either ensuring that you have proper file permissions on your pip cache (something like chown -R $(whoami) /home/ubuntu/.cache/pip) or, if you're on a UNIX, you can set the pip cache location with the XDG_CACHE_HOME env var to some folder you do own.

Solution 6 - Python

I tried the above solutions. However, I only can resolve the problem until I do:

sudo pip3 install -U pip (for python3)

Solution 7 - Python

I have this problem on my macbook also when I try to upgrade one python package. I check pip version in OS X, it's too old: 1.1. I use follow cmd to upgrade pip to 1.5.6

easy_install -U pip

Then this error is fixed.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkeflavichView Question on Stackoverflow
Solution 1 - PythonwynemoView Answer on Stackoverflow
Solution 2 - PythonKelketekView Answer on Stackoverflow
Solution 3 - PythonSeth DifleyView Answer on Stackoverflow
Solution 4 - PythonsparrowtView Answer on Stackoverflow
Solution 5 - PythonsansView Answer on Stackoverflow
Solution 6 - PythonKarimView Answer on Stackoverflow
Solution 7 - PythonNewPtoneView Answer on Stackoverflow