欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

離線安裝python的requests庫方法

 更新時間:2022年02月09日 14:27:00   作者:A_manda  
大家好,本篇文章主要講的是離線安裝python的requests庫方法,感興趣的同學趕快來看一看吧,對你有幫助的話記得收藏一下

前言

 本文詳細記錄了在win7中離線安裝python requests的過程,包括安裝requests所需依賴包。

環(huán)境:win7、python3.8.9(win7中可安裝的最新python版本)、無法連接互聯(lián)網(wǎng)

1、下載安裝包

1.1 檢查requests模塊所需依賴包

在可以上網(wǎng)且已經(jīng)安裝python的機器上檢查requests模塊需要哪些依賴包,如果這些依賴包未安裝,直接安裝requests也不能使用。

使用命令:

pip show requests

 發(fā)現(xiàn)需要chardet,idna,urllib3,certifi

檢查這幾個包是否已安裝,如果未安裝,則也需要手工安裝。

1.2 下載requests所需依賴包

在網(wǎng)站 https://www.lfd.uci.edu/~gohlke/pythonlibs 上找到相應(yīng)的程序,下載并傳輸至目標機器。

1.3 下載requests包

從github下載requests源碼包并傳輸至目標機器。

https://github.com/kennethreitz/requests

將requests-master.zip解壓到python的安裝目錄中

2、安裝

2.1 安裝requests所需依賴包

安裝命令為

 pip install xx.whl

下圖中最后一個是正常安裝成功,前面三個有報錯信息,目前暫時忽略,因為經(jīng)過驗證沒有影響requests安裝。

D:\python-lib>pip install urllib3-1.26.8-py2.py3-none-any.whl
Processing d:\python-lib\urllib3-1.26.8-py2.py3-none-any.whl
Installing collected packages: urllib3
ERROR: After October 2020 you may experience errors when installing or updating packages. 
This is because pip will change the way that it resolves dependency conflicts.
 
We recommend you use --use-feature=2020-resolver to test your packages with the
new resolver before it becomes the default.
 
requests 2.25.1 requires certifi>=2017.4.17, which is not installed.
requests 2.25.1 requires chardet<5,>=3.0.2, which is not installed.
requests 2.25.1 requires idna<3,>=2.5, which is not installed.
Successfully installed urllib3-1.26.8
 
D:\python-lib>pip install chardet-4.0.0-py3-none-any.whl
Processing d:\python-lib\chardet-4.0.0-py3-none-any.whl
Installing collected packages: chardet
ERROR: After October 2020 you may experience errors when installing or updating
packages. This is because pip will change the way that it resolves dependency co
nflicts.
 
We recommend you use --use-feature=2020-resolver to test your packages with the
new resolver before it becomes the default.
 
requests 2.25.1 requires certifi>=2017.4.17, which is not installed.
requests 2.25.1 requires idna<3,>=2.5, which is not installed.
Successfully installed chardet-4.0.0
 
D:\python-lib>pip install certifi-2019.11.28-py2.py3-none-any.whl
Processing d:\python-lib\certifi-2019.11.28-py2.py3-none-any.whl
Installing collected packages: certifi
ERROR: After October 2020 you may experience errors when installing or updating
packages. This is because pip will change the way that it resolves dependency co
nflicts.
 
We recommend you use --use-feature=2020-resolver to test your packages with the
new resolver before it becomes the default.
 
requests 2.25.1 requires idna<3,>=2.5, which is not installed.
Successfully installed certifi-2019.11.28
 
D:\python-lib>pip install idna-2.8-py2.py3-none-any.whl
Processing d:\python-lib\idna-2.8-py2.py3-none-any.whl
Installing collected packages: idna
Successfully installed idna-2.8
 
D:\python-lib>

2.2 安裝requests

在解壓好的equests-master目錄下打開cmd(或者cmd中切換目錄至該路徑)

 輸入命令開始安裝

python setup.py install

3、檢查是否安裝成功

在python中使用import requests查看

總結(jié)

到此這篇關(guān)于離線安裝python的requests庫方法的文章就介紹到這了,更多相關(guān)python requests庫離線安裝內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Python函數(shù)裝飾器實現(xiàn)方法詳解

    Python函數(shù)裝飾器實現(xiàn)方法詳解

    這篇文章主要介紹了Python函數(shù)裝飾器實現(xiàn)方法,結(jié)合實例形式較為詳細的分析了Python函數(shù)裝飾器的概念、功能、用法及相關(guān)操作注意事項,需要的朋友可以參考下
    2018-12-12
  • django教程如何自學

    django教程如何自學

    在本篇內(nèi)容里小編給大家整理了關(guān)于django教程學習流程,想自學的朋友們可以閱讀下。
    2020-07-07
  • Python 中由 yield 實現(xiàn)異步操作

    Python 中由 yield 實現(xiàn)異步操作

    這篇文章主要介紹了Python 中由 yield 實現(xiàn)異步操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-05-05
  • python scrapy重復(fù)執(zhí)行實現(xiàn)代碼詳解

    python scrapy重復(fù)執(zhí)行實現(xiàn)代碼詳解

    這篇文章主要介紹了python scrapy重復(fù)執(zhí)行實現(xiàn)代碼詳解,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下
    2019-12-12
  • 使用Python設(shè)置tmpfs來加速項目的教程

    使用Python設(shè)置tmpfs來加速項目的教程

    這篇文章主要介紹了使用Python設(shè)置tmpfs來加速項目的教程,文中給出方法使用Python腳本將tmpfs保存于內(nèi)存中的程序存儲到本地硬盤上,需要的朋友可以參考下
    2015-04-04
  • Python struct.unpack

    Python struct.unpack

    Python中按一定的格式取出某字符串中的子字符串,使用struck.unpack是非常高效的。
    2008-09-09
  • 通過數(shù)據(jù)庫對Django進行刪除字段和刪除模型的操作

    通過數(shù)據(jù)庫對Django進行刪除字段和刪除模型的操作

    這篇文章主要介紹了通過數(shù)據(jù)庫對Django進行刪除字段和刪除模型的操作,這里假設(shè)我們已經(jīng)建立了一個名為book的數(shù)據(jù)模型,需要的朋友可以參考下
    2015-07-07
  • 在Python中表示一個對象的方法

    在Python中表示一個對象的方法

    這篇文章主要介紹了在Python中表示一個對象的方法,本文通過實例代碼給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-06-06
  • python實現(xiàn)人機對戰(zhàn)的五子棋游戲

    python實現(xiàn)人機對戰(zhàn)的五子棋游戲

    這篇文章主要為大家詳細介紹了python實現(xiàn)人機對戰(zhàn)的五子棋游戲,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-04-04
  • 將圖片文件嵌入到wxpython代碼中的實現(xiàn)方法

    將圖片文件嵌入到wxpython代碼中的實現(xiàn)方法

    前面一篇文章中提到的那個程序,GUI中包含了一張圖片。在編譯成exe文件發(fā)布時,無法直接生成一個單獨的exe文件。因此需要直接把圖片寫入到代碼中
    2014-08-08

最新評論