先執行以下命令(因為我在另一個終端執行,所以history的編號有重復)
7 wget https://pypi.python.org/packages/source/p/pycurl/pycurl-7.19.3.1.tar.gz --no-check-
8 tar -zxvf pycurl-7.19.3.1.tar.gz
9 cd pycurl-7.19.3.1/
10 ls
11 yum install python-devel gcc* libcurl-devel openssl-libs-1.0.2k-8.el7.x86_64 -y
12 kill -9 3688 #因為我yum被鎖了
13 yum install python-devel gcc* libcurl-devel openssl-libs-1.0.2k-8.el7.x86_64 -y
[root@localhost pycurl-7.19.3.1]# history
1 ifconfig
2 ping www.baidu.com
3 ifconfig|grep 'inet '
4 systemctl restart network
5 ifconfig|grep 'inet '
6 ping 10.0.3.14
7 wget http://curl.haxx.se/download/curl-7.36.0.tar.gz
8 tar -zxvf curl-7.36.0.tar.gz
9 cd curl-7.36.0/
10 ls
11 ./configure
12 make && make install
13 export LD_LIBRARY_PATH=/usr/local/lib #這里也是關鍵,否則會報錯ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (none/other) 注意export,也就是說只能在當前終端有效,另開一個終端會失效
14 cd ..
15 cd pycurl-7.19.3.1/
16 ls
17 python setup.py install --curl-config=/usr/local/bin/curl-config
[root@localhost pycurl-7.19.3.1]# python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl
>>> quit()
