国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

Python pip install之SSL異常處理操作

瀏覽:7日期:2022-07-12 13:11:57

異常內容:

C:Usersccwant>pip install requestsCollecting requestsRetrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ’SSLError(SSLError(1, ’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)’),)’: /simple/requests/Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ’SSLError(SSLError(1, ’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)’),)’: /simple/requests/Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ’SSLError(SSLError(1, ’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)’),)’: /simple/requests/Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ’SSLError(SSLError(1, ’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)’),)’: /simple/requests/Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ’SSLError(SSLError(1, ’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)’),)’: /simple/requests/Could not fetch URL https://pypi.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLError(1, ’[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)’),)) - skippingCould not find a version that satisfies the requirement requests (from versions: )No matching distribution found for requests

處理辦法:

打開以下目錄,并創(chuàng)建pip文件夾

C:Users用戶AppDataRoaming

進入pip文件夾,創(chuàng)建pip.ini文件,內容如下

[global]index-url = http://mirrors.aliyun.com/pypi/simple/[install]trusted-host = mirrors.aliyun.com

此配置的作用是修改pip的安裝源,此處修改為阿里的源,然后使用pip install安裝就不會報錯了

補充知識:處理Python3中使用pip install時提示'SSL: CERTIFICATE_VERIFY_FAILED'

CentOS7使用官方y(tǒng)um源安裝了Python3和pip(yum搜不到python3的話請安裝epel-release)

[root@client0 yum.repos.d]# python3 --versionPython 3.6.8[root@client0 yum.repos.d]# pip3 --versionpip 8.1.2 from /usr/lib/python3.6/site-packages (python 3.6)

使用pip安裝包時會提示你pip版本過低, 建議使用pip install --upgrade pip命令來升級.

而使用該命令時則會彈出一連串錯誤提示, 其中包含關鍵字'SSL: CERTIFICATE_VERIFY_FAILED'

這時的處理辦法是跳過pip的SSL驗證

使用命令

pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>

即可.

以上這篇Python pip install之SSL異常處理操作就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持好吧啦網。

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 青铜峡市| 阿巴嘎旗| 五河县| 诏安县| 南汇区| 汨罗市| 龙海市| 三河市| 康乐县| 曲水县| 龙海市| 河西区| 潞城市| 惠东县| 南汇区| 辰溪县| 娱乐| 延寿县| 奉新县| 孝昌县| 潞城市| 咸丰县| 山东省| 博罗县| 永胜县| 博罗县| 繁昌县| 普安县| 阆中市| 龙门县| 分宜县| 嘉祥县| 旺苍县| 韶关市| 安国市| 宜春市| 城口县| 牡丹江市| 龙陵县| 西盟| 鱼台县|