Could not fetch URL https://pypi.org/simple/dify-plugin/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/dify-plugin/ (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1010)’))) – skipping
如何修复 – Python pip install 连接错误 SSL CERTIFICATE_VERIFY_FAILED 证书验证失败
1.您需要在安装命令下添加至少两个参数 –
参数 1:--trusted-host pypi.org
参数 2:--trusted-host files.pythonhosted.org
pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org <app>
或者
python3 -m pip install --upgrade Scrapy --trusted-host pypi.org --trusted-host files.pythonhosted.org
2. 通过在 pip.conf 文件中添加 host 来修复错误
Python 允许您借助 pip.conf 文件设置默认命令行选项。
pip.conf根据您的操作系统找到您的文件 -
1. MacOS - $HOME/Library/Application Support/pip/pip.conf
2. Unix $HOME/.config/pip/pip.conf
3. Windows - %APPDATA%\pip\pip.ini
打开文件并在参数下pip.conf添加-trusted-hostglobal
[global]
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org
重新启动你的 python,然后 pip 安装程序将永久信任这些主机。