gpt4 book ai didi

python - 使用 pip3 安装软件包时出现 "ssl module in Python is not available"

转载 作者:IT老高 更新时间:2023-10-28 20:23:28 24 4
gpt4 key购买 nike

我已在本地机器上成功安装 Python 3.4 和 Python 3.6,但无法安装带有 pip3 的软件包.

当我执行 pip3 install <package> ,我收到以下 SSL 相关 错误:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting <package>
Could not fetch URL https://pypi.python.org/simple/<package>/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement <package> (from versions: )
No matching distribution found for <package>

如何修复我的 Python3.x 安装,以便我可以安装带有 pip install <package> 的软件包?

最佳答案

在 Ubuntu 中安装 Python 3.6 和 pip3 的分步指南

  1. 为 Python 和 ssl 安装必要的软件包:$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

  2. https://www.python.org/ftp/python/下载并解压“Python-3.6.8.tar.xz”进入你的主目录。

  3. 在该目录中打开终端并运行:$ ./configure

  4. 构建和安装:$ make && sudo make install

  5. 安装包:$ pip3 install package_name

免责声明:以上命令未在 Ubuntu 20.04 LTS 中测试。

关于python - 使用 pip3 安装软件包时出现 "ssl module in Python is not available",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41328451/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com