解決:Python通過pip安裝庫時(shí)報(bào)錯(cuò):ERROR: Cannot unpack file …; ERROR: Cannot determine archive format of …
背景
在使用之前的代碼時(shí),報(bào)錯(cuò):
ERROR: Cannot unpack file C:\Users\Matcha\AppData\Local\Temp\pip-unpack-qdrm7q1e\simple.htm (downloaded from C:\Users\Matcha\AppData\Local\Temp\pip-req-build-xkgrt0zv, content-type: text/html); cannot detect archive format ERROR: Cannot determine archive format of C:\Users\Matcha\AppData\Local\Temp\pip-req-build-xkgrt0zv
報(bào)錯(cuò)問題
ERROR: Cannot unpack file C:\Users\Matcha\AppData\Local\Temp\pip-unpack-qdrm7q1e\simple.htm (downloaded from C:\Users\Matcha\AppData\Local\Temp\pip-req-build-xkgrt0zv, content-type: text/html); cannot detect archive format ERROR: Cannot determine archive format of C:\Users\Matcha\AppData\Local\Temp\pip-req-build-xkgrt0zv
報(bào)錯(cuò)截圖如下:
報(bào)錯(cuò)翻譯
主要報(bào)錯(cuò)信息內(nèi)容翻譯如下所示:
ERROR: Cannot unpack file C:\Users\Matcha\AppData\Local\Temp\pip-unpack-qdrm7q1e\simple.htm (downloaded from C:\Users\Matcha\AppData\Local\Temp\pip-req-build-xkgrt0zv, content-type: text/html); cannot detect archive format ERROR: Cannot determine archive format of C:\Users\Matcha\AppData\Local\Temp\pip-req-build-xkgrt0zv
翻譯:
錯(cuò)誤:無法解壓縮文件 C:\Users\Matcha\AppData\Local\Temp\pip-unpack-qdrm7q1e\simple.htm(從 C:\Users\Matcha\AppData\Local\Temp\pip-req-build-xkgrt0zv 下載,內(nèi)容類型:text/html);無法檢測(cè)存檔格式錯(cuò)誤:無法確定 C:\Users\Matcha\AppData\Local\Temp\pip-req-build-xkgrt0zv
報(bào)錯(cuò)原因
經(jīng)過查閱資料,發(fā)現(xiàn)是網(wǎng)絡(luò)問題或者使用的源不對(duì)。
注意:部分國外源國內(nèi)不能正常訪問。
小伙伴們按下面的解決方法即可解決?。?!
解決方法
要解決這個(gè)錯(cuò)誤,需要使用國內(nèi)源,本文以清華源為例
使用命令:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn 包名
效果截圖如下
附,國內(nèi)常用的源:
由于受到網(wǎng)絡(luò)影響,國外的網(wǎng)站一般要比國內(nèi)的網(wǎng)站網(wǎng)速慢,有時(shí)候不能正常訪問,影響安裝速度。所以可以使用國內(nèi)的源安裝,常用的源如下文章來源:http://www.zghlxwxcb.cn/news/detail-764915.html
阿里云 http://mirrors.aliyun.com/pypi/simple/
??中國科技大學(xué) https://pypi.mirrors.ustc.edu.cn/simple/
??豆瓣(douban) http://pypi.douban.com/simple/
??清華大學(xué) https://pypi.tuna.tsinghua.edu.cn/simple/
??中國科學(xué)技術(shù)大學(xué) http://pypi.mirrors.ustc.edu.cn/simple/
今天的分享就到此結(jié)束了
文章來源地址http://www.zghlxwxcb.cn/news/detail-764915.html
到了這里,關(guān)于解決:Python通過pip安裝庫時(shí)報(bào)錯(cuò):ERROR: Cannot unpack file ...; ERROR: Cannot determine archive format of ...的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!