一、ERROR: Cannot determine archive format of xxx

问题使用pin镜像下载第三方包时打印如下错误

ERROR: Cannot unpack file C:UsersxxxAppDataLocalTemppip-unpack-d7k91f69simple.htm (downloaded from C:UsersxxxAppDataLocalTemppip-req-build-i7r7p3x1, content-type: text/html); cannot detect archive format
ERROR: Cannot determine archive format of C:UsersxxxAppDataLocalTemppip-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

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注