centos7安装pycurlcss
出现错误python
FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'
ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
https://github.com/pycurl/pycurl/pull/353git
安装包解决办法:
从新安装如下的库
centosgithub
yum install libcurl-develcentos
因为libcurl的源码编译因素,在安装pycurl可能会致使如下两种错误。ruby
错误1:bash
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)curl
错误2:ui
ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)url
解决办法:
错误1的解决办法以下:
pip uninstall pycurl
export PYCURL_SSL_LIBRARY=openssl
pip install pycurl
错误2的解决办法以下:
pip uninstall pycurl
export PYCURL_SSL_LIBRARY=nss
pip install pycurl
结果
Installing collected packages: pycurl Running setup.py install for pycurl ... done Successfully installed pycurl-7.43.0.1
源码解决办法
wget http://curl.haxx.se/download/curl-7.24.0.tar.gz
tar -zxvf curl-7.24.0.tar.gz
cd curl-7.24.0 ./configure make && make install
安装pycurl,使用--curl-config=制定curl-config的路径
wget https://dl.bintray.com/pycurl/pycurl/pycurl-7.43.0.1.tar.gz tar -xzvf pycurl-7.43.0.1.tar.gz cd pycurl-7.43.0.1 python3 setup.py --with-openssl install --curl-config=/usr/local/bin/curl-config
结果
Using /usr/local/bin/curl-config (libcurl 7.24.0) running install running build running build_py creating build ...... Writing /usr/local/python3/lib/python3.6/site-packages/pycurl-7.43.0.1-py3.6.egg-info
安装成功