欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 社会 > CentOS/Linux Python 2.7 离线安装 Requests 库解决离线安装问题。

CentOS/Linux Python 2.7 离线安装 Requests 库解决离线安装问题。

2025/2/3 8:13:44 来源:https://blog.csdn.net/Asong_6/article/details/145366018  浏览:    关键词:CentOS/Linux Python 2.7 离线安装 Requests 库解决离线安装问题。

root@mwcollector1 externalscripts]# cat /etc/os-release
NAME=“Kylin Linux Advanced Server”
VERSION=“V10 (Sword)”
ID=“kylin”
VERSION_ID=“V10”
PRETTY_NAME=“Kylin Linux Advanced Server V10 (Sword)”
ANSI_COLOR=“0;31”
这是我系统的版本,由于是公司内网环境,由于缺少联网环境。
提示了这个错误
root@mwcollector1 externalscripts]# python ManageOne1.py oc.cd-caacsri-1.caacsricloud.com maowei_api_user ‘Mx(6oTg=Quote7NDebra’ vm
Traceback (most recent call last):
File “ManageOne1.py”, line 5, in
import requests
ImportError: No module named requests
[root@mwcollector1 externalscripts]#
现在需要安装requests。由于python的版本是以下:
python --version
Python 2.7.18
为了适应,需要安装setuptools,pip,certifi,chardet,idna,urllib3,requests。
对于 Python 2.7.18,以下是各个包需要安装的合适版本(这些版本都是相互兼容的最后稳定版本):

1.setuptools:

setuptools==44.1.1  # 最后支持 Python 2.7 的版本

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com