由于这个错误,我正在尝试使用 OpenSSL 重建 pycurl 。我用这个例子:
- sudo apt-get install build-essential fakeroot dpkg-dev
- mkdir ~/python-pycurl-openssl
- cd ~/python-pycurl-openssl
- sudo apt-get 源码 python-pycurl
- sudo apt-get build-dep python-pycurl
- sudo apt-get install libcurl4-openssl-dev
- sudo dpkg-source -x pycurl_7.19.3-0ubuntu3.dsc
- cd pycurl-7.19.3
- 编辑 debian/control 文件并用 'libcurl4-openssl-dev' 替换所有 'libcurl4-gnutls-dev' 实例(7 处更改)
- sudo PYCURL_SSL_LIBRARY=openssl dpkg-buildpackage -rfakeroot -b
- sudo dpkg -i ../python-pycurl_7.19.3-0ubuntu3_amd64.deb
但毕竟我仍然坚持使用 pycurl 的 GnuTLS 构建。
>>> pycurl.version
'PycURL/7.19.5.1 libcurl/7.35.0 GnuTLS/2.12.23 zlib/1.2.8 libidn/1.28 librtmp/2.3'
操作日志(有一些错误的回溯): http: //pastebin.com/6hUEUGar
我用:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
我究竟做错了什么?
我可以使用 pip 解决问题:
sudo pip uninstall pycurl
export PYCURL_SSL_LIBRARY=openssl
sudo pip install pycurl --upgrade
现在:
>>> pycurl.version
'PycURL/7.19.5.1 libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3'
但我不确定它是否正确。为什么系统中有两个包?或者没关系,python 只是链接到其中之一?