使用诗添加networkx cmd获取SSLError

问题描述 投票:0回答:1

我正在使用诗歌(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
时遇到此错误。有人可以帮我解决这个问题吗?这是我的项目的一个关键依赖项,如果可能的话我想使用诗歌。

提前致谢。

python-3.x python-poetry
1个回答
0
投票

这适用于 Windows。

  1. 使用浏览器连接到任何 https 站点。

  2. 单击

    https://
    左侧的锁定图标。

  3. 查看并保存根证书。

  4. 将证书转换为

    .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"
    
  5. 在记事本/记事本++中打开

    my_cert.pem
    。复制文字

  6. 找到您的

    cacert.pem
    。就我而言,它位于以下路径中:

    C:\Users\<my_username>\.poetry\lib\poetry\_vendor\py3.9\certifi\cacert.pem
    
  7. 将步骤 5 中复制的文本粘贴到

    cacert.pem
    并保存。

  8. 运行

    poetry add <package-name>

© www.soinside.com 2019 - 2024. All rights reserved.