0

Ubuntu - 16.04 Python - 2.7.12

Hi guys, I'm trying install pycurl==7.19.0 from setup.py, but catch this stack trace:

Downloading https://pypi.python.org/packages/11/73/abcfbbb6e1dd7087fa53042c301c056c11264e8a737a4688f834162d731e/pycurl-7.19.0.tar.gz#md5=074cd44079bb68697f5d8751102b384b
Best match: pycurl 7.19.0
Processing pycurl-7.19.0.tar.gz
Writing /tmp/easy_install-F8gcvD/pycurl-7.19.0/setup.cfg
Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-F8gcvD/pycurl-7.19.0/egg-dist-tmp-8sbXeG
Using curl-config (libcurl 7.47.0)
src/pycurl.c: In function ‘multi_socket_callback’:
src/pycurl.c:2351:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
     int ret;
         ^
src/pycurl.c: In function ‘initpycurl’:
src/pycurl.c:3453:31: warning: macro "__DATE__" might prevent reproducible builds [-Wdate-time]
     insstr(d, "COMPILE_DATE", __DATE__ " " __TIME__);
                               ^
src/pycurl.c:3453:44: warning: macro "__TIME__" might prevent reproducible builds [-Wdate-time]
     insstr(d, "COMPILE_DATE", __DATE__ " " __TIME__);
                                            ^
/usr/bin/ld: cannot find -lidn
/usr/bin/ld: cannot find -lrtmp
/usr/bin/ld: cannot find -lgssapi_krb5
/usr/bin/ld: cannot find -lkrb5
/usr/bin/ld: cannot find -lk5crypto
/usr/bin/ld: cannot find -lcom_err
/usr/bin/ld: cannot find -llber
/usr/bin/ld: cannot find -llber
/usr/bin/ld: cannot find -lldap
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Does anyone known what's wrong?

Yura
  • 1
  • 3
  • I tried it, not helped – Yura Sep 16 '16 at 12:59
  • @Bhargav The duplicate target question is way too broad and just a hodgepodge of random answers without a clear, definitive answer to fix this problem. I think it's a poor duplicate. – Uyghur Lives Matter Sep 19 '16 at 16:17
  • @cpburnz I've reopened. True, It is a mixture of answers (The libcurl answer is 10th down). If you do find time, try to cleanse that post. – Bhargav Rao Sep 19 '16 at 16:23
  • Unless you're really just trying to use curl, I'd use [requests](http://docs.python-requests.org/en/master/) instead – Wayne Werner Sep 19 '16 at 16:24

3 Answers3

1

These lines:

/usr/bin/ld: cannot find -lidn
/usr/bin/ld: cannot find -lrtmp
/usr/bin/ld: cannot find -lgssapi_krb5
/usr/bin/ld: cannot find -lkrb5
/usr/bin/ld: cannot find -lk5crypto
/usr/bin/ld: cannot find -lcom_err
/usr/bin/ld: cannot find -llber
/usr/bin/ld: cannot find -llber
/usr/bin/ld: cannot find -lldap

Mean the libraries idn, rtmp, gssapi_krb5, krb5, k5crypto, com_err, lber, and ldap could not be found which most likely means they are not installed. I checked the dependencies of libcurl3 and it directly depends on gssapi-krb5-2 (which depends on krb5-3 and k5crypto3), idn11, ldap, rtmp1, ssl1.

So, installing libcurl3 should solve your problem:

sudo apt-get install libcurl3

After that's installed, try installing pycurl again.

Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
0

I don't know, i tried everything, i think that i had problem with pip install, i usually use sudo pip install.... so maybe some libraries don't have permissions to read. I restored snapshot with empty ubuntu and install all libraries again, without 'SUDO' pip install, thanx a lot for all answers.

Yura
  • 1
  • 3
-1

Try: sudo apt-get install python-dev

loganasherjones
  • 1,012
  • 2
  • 11
  • 19