python2.7源码安装requests模块

1、下载源码包

[root@localhost ~]# wget https://pypi.python.org/packages/5b/0b/34be574b1ec997247796e5d516f3a6b6509c4e064f2885a96ed885ce7579/requests-2.12.4.tar.gz

2、解压缩

[root@localhost ~]# tar -zxvf requests-2.12.4.tar.gz

3、进入解压缩目录

[root@localhost ~]# cd requests-2.12.4

4、安装

[root@localhost requests-2.12.4]# requests-2.12.4]# python setup.py install

5、测试是否安装成功

[root@localhost requests-2.12.4]# python
Python 2.7.5 (default, Oct 14 2020, 14:45:30) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> exit()
posted @ 2023-03-31 10:37  nhxuan  阅读(1117)  评论(0)    收藏  举报