"Python中的ssl模块不可用";使用pip3安装软件包时 [英] "ssl module in Python is not available" when installing package with pip3

查看:92
本文介绍了"Python中的ssl模块不可用";使用pip3安装软件包时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在本地计算机上成功安装了Python 3.4和Python 3.6,但是无法使用pip3安装软件包.

I've install Python 3.4 and Python 3.6 on my local machine successfully, but am unable to install packages with pip3.

执行pip3 install <package>时,出现以下与SSL相关的错误:

When I execute pip3 install <package>, I get the following SSL related error:

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>安装软件包?

How can I fix my Python3.x install so that I can install packages with 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

https:/下载并解压缩"Python-3.6.8.tar.xz" /www.python.org/ftp/python/到您的主目录中.

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

Open terminal in that directory and run: $ ./configure

构建并安装:$ sudo make && sudo make install

使用以下软件包安装软件包:$ pip3 install package_name

Install packages with: $ pip3 install package_name

这篇关于"Python中的ssl模块不可用";使用pip3安装软件包时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆