方法1:可通过镜像服务器下载,使用命令:pip install 模块名 -i https://pypi.tuna.tsinghua.edu.cn/simple/
其中的url地址也可以替换为其他镜像地址,举例如下:
https://pypi.doubanio.com/simple
https://pypi.mirrors.ustc.edu.cn/simple
http://pypi.douban.com/simple/
http://mirrors.aliyun.com/pypi/simple/
方法2:链接: https://www.lfd.uci.edu/~gohlke/pythonlibs/
Ctrl+F 搜索自己需要的库,下载文件之后,使用命令安装:pip install 文件名
这样可以避免出现直接pip安装失败的情况。