今天就跟大家聊聊有關(guān)怎么在Python3中安裝Requests模塊,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
操作系統(tǒng):Windows Server 2012 x64
python3安裝
官網(wǎng)下載最新的適合windows 的安裝包。
下載下來的python-3.7.4-amd64.exe,直接拷貝到測試環(huán)境的機(jī)器上,雙擊安裝即可,需要注意的是,最好勾選 AddPython 3.7 to PATH,這樣后期直接在cmd窗口中就可以調(diào)用python命令了。
requests模塊的依賴包檢查
在可以上網(wǎng)且已安裝python的機(jī)器上檢查requests模塊需要哪些依賴包,要是沒有依賴包,直接下載一個(gè)直接安裝最好。
在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
安裝模塊
將以上下載的文件傳到測試環(huán)境。離線裝模塊。
安裝命令為 pip install XXXXX.whl
切記,先安裝依賴包,如果直接安裝requests,由于有依賴包,還是會(huì)去連外網(wǎng)找依賴包。
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
看完上述內(nèi)容,你們對怎么在Python3中安裝Requests模塊有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。
網(wǎng)站題目:怎么在Python3中安裝Requests模塊-創(chuàng)新互聯(lián)
分享地址:http://jinyejixie.com/article12/dieggc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)、標(biāo)簽優(yōu)化、App開發(fā)、全網(wǎng)營銷推廣、虛擬主機(jī)、響應(yīng)式網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容