一、ERROR: Cannot determine archive format of xxx
问题:使用pin镜像源下载第三方包时打印如下错误:
ERROR: Cannot unpack file C:\Users\xxx\AppData\Local\Temp\pip-unpack-d7k91f69\simple.htm (downloaded from C:\Users\xxx\AppData\Local\Temp\pip-req-build-i7r7p3x1, content-type: text/html); cannot detect archive format
ERROR: Cannot determine archive format of C:\Users\xxx\AppData\Local\Temp\pip-req-build-i7r7p3x1
二、解决方案
解决方案:添加对镜像源的信任,在安装时采用如下命令:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn package_you_want
举例:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn torchvision