我正在使用诗歌(1.0.10)来管理项目的依赖关系。
我当前在运行时遇到 SSLError
poetry add networkx
[SSLError]
HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/networkx/json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
看来我只在
networkx
时遇到此错误。有人可以帮我解决这个问题吗?这是我的项目的一个关键依赖项,如果可能的话我想使用诗歌。
提前致谢。
这适用于 Windows。
使用浏览器连接到任何 https 站点。
单击
https://
左侧的锁定图标。
查看并保存根证书。
将证书转换为
.pem
我使用了git自带的OpenSSL。
cd C:\Users\<my_username>\AppData\Local\Programs\Git\usr\bin>
./openssl x509 -in "C:\Users\<my_username>\<my_folder>\my_cert.cer" -out "C:\Users\<my_username>\<my_folder>\my_cert.pem"
在记事本/记事本++中打开
my_cert.pem
。复制文字
找到您的
cacert.pem
。就我而言,它位于以下路径中:
C:\Users\<my_username>\.poetry\lib\poetry\_vendor\py3.9\certifi\cacert.pem
将步骤 5 中复制的文本粘贴到
cacert.pem
并保存。
运行
poetry add <package-name>
。