Python-pycurl模块的安装

 

先执行以下命令(因为我在另一个终端执行,所以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()

posted on 2018-02-26 15:44  标配的小号  阅读(4561)  评论(0编辑  收藏  举报

导航