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
方法三
配置多個鏡像源(方法二設置后為默認鏡像源,這里多個兩個鏡像源平衡負載,分別是清華大學源、豆瓣源)
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é)
到此這篇關于python清華pip鏡像源報HTTP error 403錯誤解決的文章就介紹到這了,更多相關清華pip鏡像源報HTTP error 403內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
python subprocess pipe 實時輸出日志的操作
這篇文章主要介紹了python subprocess pipe 實時輸出日志的操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-12-12python讓圖片按照exif信息里的創(chuàng)建時間進行排序的方法
這篇文章主要介紹了python讓圖片按照exif信息里的創(chuàng)建時間進行排序的方法,涉及Python操作圖片exif獲取信息的技巧,需要的朋友可以參考下2015-03-03