0

Python 2.7.12

pip 8.1.2

ubuntu-16.04

I'm trying to install pycurl using:

pip install pycurl

this is what I get,

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8EU20I/pycurl/

So, I tried updating setup tools like this:

pip install --upgrade easy_install -U setuptools

i got

Could not find a version that satisfies the requirement easy_install (from versions: ) No matching distribution found for easy_install

I've no idea on what I'm missing. Please help me out!

iamgr007
  • 966
  • 1
  • 8
  • 28
  • `easy_install` is a command included with `setuptools`. Try upgrading it with just `python -m pip install -U setuptools`. – jonafato Aug 22 '16 at 20:49
  • Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages – iamgr007 Aug 23 '16 at 07:53
  • `pip` and `easy_install` are probably not the issue here. Do you have `libcurl` installed, per the [installation docs](http://pycurl.io/docs/latest/install.html#pycurl-installation)? – jonafato Aug 23 '16 at 16:57

3 Answers3

2
sudo apt-get install python-pycurl

this solved the problem.

iamgr007
  • 966
  • 1
  • 8
  • 28
0

The issue here is that you are attempting to upgrade the setuptools that came installed in your system Python, which requires changes to areas of the file system a "normal" user won't have (it requires root privileges).

Prefixing the command with sudo might help, but you should ask yourself whether you really want to change the system Python, since some OSs require Python "as installed" for various system purposes.

It's a lot safer to install a second copy of Python somewhere you have write access to (I personally tend to use /usr/local but YMMV) and then you won't need to worry about breaking your system. Further, as long as you set your PATH to include /usr/local/bin you can just use the python command to run it.

holdenweb
  • 33,305
  • 7
  • 57
  • 77
-1

Remove the virtual environment folder and recreate/reinstall it using virtualenv sampleenv .This may solve your problem