I find that recently often when I try to install a Python package using pip, I get the error(s) below.
I found a reference online that one has to use "python2 setup.py install" from the download directory, and indeed find that this will then work if I manually find and download the package (from pypi).
But, I don't know where pip is downloading packages to, and/or why it is failing in this manner.
I tried to do a pip upgrade, but it also failed in a similar manner, with a bunch of "Unknown distribution option" errors (entry_points, zip_safe, test_suite, tests_require)!
- pip 1.0.1
- ActivePython 2.7
Trying to use ActiveState's pypm fails, because they have a smaller library base, and it doesn't include these packages.
C:\test>pip install requests-oauth
Downloading/unpacking requests-oauth
Downloading requests-oauth-0.4.1.tar.gz
Running setup.py egg_info for package requests-oauth
E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
Complete output from command python setup.py egg_info:
E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
None of the above worked for me on Ubuntu 12.04 LTS (Precise Pangolin), and here's how I fixed it in the end:
Download ez_setup.py from download setuptools (see "Installation Instructions" section) then:
I hope it saves someone some time.
For me upgrading pip from 8.1.1 to 9.0.1 solved this problem.
You can run something like
sudo -H pip2 install --upgrade pip
to upgrade your pip version.This error can occur when you trying to install
pycurl
.In this case you should do
(founded here: https://gist.github.com/lxneng/1031014 )
Looks like the default easy_install is broken in its current location:
$ which easy_install /usr/bin/easy_install
A way to overcome this is to use the easy_install in site packages. For example:
$ sudo python /Library/Python/2.7/site-packages/easy_install.py boto
try the following command:
On CentOS 6.5, the short answer from a clean install is:
yum -y install python-pip pip install -U pip pip install -U setuptools pip install -U setuptools
You are not seeing double, you must run the setuptools upgrade twice. The long answer is below:
Installing the
python-pip
package using yum bringspython-setuptools
along as a dependency. It's a pretty old version and hence it's actually installingdistribute (0.6.10)
. After installing a package manager we generally want to update it, so we dopip install -U pip
. Current version of pip for me is 1.5.6.Now we go to update setuptools and this version of pip is smart enough to know it should remove the old version of distribute first. It does this, but then instead of installing the latest version of setuptools it installs
setuptools (0.6c11)
.At this point all kinds of things are broken due to this extremely old version of setuptools, but we're actually halfway there. If we now run the exact same command a second time,
pip install -U setuptools
, the old version of setuptools is removed, and version 5.5.1 is installed. I don't know why pip doesn't take us straight to the new version in one shot, but this is what's happening and hopefully it will help others to see this and know you're not going crazy.