今天就跟大家聊聊有关怎么在Python3中安装Requests模块,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。
公司主营业务:网站设计、成都网站建设、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联建站是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联建站推出宁县免费做网站回馈大家。操作系统:Windows Server 2012 x64
python3安装
官网下载最新的适合windows 的安装包。
下载下来的python-3.7.4-amd64.exe,直接拷贝到测试环境的机器上,双击安装即可,需要注意的是,最好勾选 AddPython 3.7 to PATH,这样后期直接在cmd窗口中就可以调用python命令了。
requests模块的依赖包检查
在可以上网且已安装python的机器上检查requests模块需要哪些依赖包,要是没有依赖包,直接下载一个直接安装最好。
在CMD命令窗口中输入 pip show requests
C:\Users\Laycher>pip show requests Name: requests Version: 2.18.4 Summary: Python HTTP for Humans. Home-page: http://python-requests.org Author: Kenneth Reitz Author-email: me@kennethreitz.org License: Apache 2.0 Location: d:\program files\python3\lib\site-packages Requires: chardet, urllib3, idna, certifi Required-by:
下载依赖包模块和requests模块
certifi-2019.9.11-py2.py3-none-any.whl chardet-3.0.4-py2.py3-none-any.whl idna-2.8-py2.py3-none-any.whl requests-2.22.0-py2.py3-none-any.whl urllib3-1.25.6-py2.py3-none-any.whl
安装模块
将以上下载的文件传到测试环境。离线装模块。
安装命令为 pip install XXXXX.whl
切记,先安装依赖包,如果直接安装requests,由于有依赖包,还是会去连外网找依赖包。
D:\软件>pip install certifi-2019.9.11-py2.py3-none-any.whl Processing d:\软件\certifi-2019.9.11-py2.py3-none-any.whl Installing collected packages: certifi Successfully installed certifi-2019.9.11 D:\软件>pip install chardet-3.0.4-py2.py3-none-any.whl Processing d:\软件\chardet-3.0.4-py2.py3-none-any.whl Installing collected packages: chardet Successfully installed chardet-3.0.4 D:\软件>pip install idna-2.8-py2.py3-none-any.whl Processing d:\软件\idna-2.8-py2.py3-none-any.whl Installing collected packages: idna Successfully installed idna-2.8 D:\软件>pip install urllib3-1.25.6-py2.py3-none-any.whl Processing d:\软件\urllib3-1.25.6-py2.py3-none-any.whl Installing collected packages: urllib3 Successfully installed urllib3-1.25.6 D:\软件>pip install requests-2.22.0-py2.py3-none-any.whl Processing d:\软件\requests-2.22.0-py2.py3-none-any.whl Requirement already satisfied: idna in c:\users\administrator\appdata\local\prog rams\python\python37\lib\site-packages (from requests==2.22.0) (2.8) Requirement already satisfied: chardet in c:\users\administrator\appdata\local\p rograms\python\python37\lib\site-packages (from requests==2.22.0) (3.0.4) Requirement already satisfied: urllib3 in c:\users\administrator\appdata\local\p rograms\python\python37\lib\site-packages (from requests==2.22.0) (1.25.6) Requirement already satisfied: certifi in c:\users\administrator\appdata\local\p rograms\python\python37\lib\site-packages (from requests==2.22.0) (2019.9.11) Installing collected packages: requests Successfully installed requests-2.22.0
看完上述内容,你们对怎么在Python3中安装Requests模块有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注创新互联行业资讯频道,感谢大家的支持。