我已在本地计算机上成功安装 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 的分步指南
-
安装 Python 和 ssl 所需的包:$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
-
从以下地址下载并解压“Python-3.6.8.tar.xz”https://www.python.org/ftp/python/进入你的主目录。
-
在该目录中打开终端并运行:$ ./configure
-
构建并安装:$ make && sudo make install
-
安装软件包:$ pip3 install package_name
免责声明:以上命令未在 Ubuntu 20.04 LTS 中测试。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)