win下pip.ini设置
pip安装发现报错
D:\>pip list
Package Version
---------- -------
pip 20.2.3
setuptools 49.2.1
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))) - skipping
编写 pip.ini
这里使用的是aliyun的源
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com
确保pip.ini 在环境变量中
需要确保pip.ini 在环境变量 path 中
一般python的目录会被放在环境变量 path中,可以直接将 pip.ini文件放在当前系统正在使用的 python目录下,即可。