在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配置问题了。
参考