在Windows%appdata%/pip/pip.ini(无则新增对应文件夹及文件)
[global]
timeout = 6000
#index-url = https://pypi.tuna.tsinghua.edu.cn/simple
#trusted-host = pypi.tuna.tsinghua.edu.cn
index-url = http://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
效果切换后可以执行pip install tensorflow==2.4.1了,不在提示连接国外网站时候提示ssl配置问题了。
参考
本文介绍如何通过修改Windows系统的pip配置文件来指定国内镜像源,以解决安装Python包时遇到的SSL配置问题。通过将pip的index-url设置为阿里云镜像,成功解决了安装TensorFlow 2.4.1版本时出现的连接国外网站失败的问题。
7913

被折叠的 条评论
为什么被折叠?



