python清華pip鏡像源報HTTP error 403錯誤解決辦法
報錯信息
ERROR: HTTP error 403 while getting https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/52/79/a64937a2185b91a96cc5406e3ea58120980c725543d047e112fb3084a972/fake_useragent-2.0.0-py3-none-any.whl (from https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/fake-useragent/)
解決辦法
方法一:
臨時更改鏡像源(阿里鏡像源)
Package更換為自己所需安裝的包
pip install -i http://mirrors.aliyun.com/pypi/simple Package --trusted-host mirrors.aliyun.com
方法二
永久更換源(阿里鏡像源)
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
pip config set install.trusted-host mirrors.aliyun.com
方法三
配置多個鏡像源(方法二設(shè)置后為默認鏡像源,這里多個兩個鏡像源平衡負載,分別是清華大學源、豆瓣源)
pip config set global.extra-index-url "https://pypi.tuna.tsinghua.edu.cn/simple http://pypi.douban.com/simple"
配置多個可信任主機(域名),分別為阿里、清華大學、豆瓣鏡像域名
pip config set install.trusted-host "mirrors.aliyun.com mirrors.tuna.tsinghua.edu.cn pypi.douban.com"
最后清除緩存及時生效(方法二、方法三用到)
pip cache purge
總結(jié)
到此這篇關(guān)于python清華pip鏡像源報HTTP error 403錯誤解決的文章就介紹到這了,更多相關(guān)清華pip鏡像源報HTTP error 403內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Yolov5(v5.0)+pyqt5界面設(shè)計圖文教程
眾所周知界面設(shè)計一般指UI設(shè)計,下面這篇文章主要給大家介紹了關(guān)于Yolov5(v5.0)+pyqt5界面設(shè)計的相關(guān)資料,文中通過圖文以及實例代碼介紹的非常詳細,需要的朋友可以參考下2023-04-04
python讀取.mat文件的數(shù)據(jù)及實例代碼
這篇文章主要介紹了python讀取.mat文件的數(shù)據(jù)的方法,本文給大家介紹的非常詳細,具有一定的參考借鑒價值 ,需要的朋友可以參考下2019-07-07

