提问者:小点点

当使用pip3安装包时,"Python中的ssl模块不可用"


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

当我执行pip3安装时

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>

我怎样才能修好我的蟒蛇。x安装,这样我就可以安装带有pip安装的软件包了


共3个答案

匿名用户

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

>

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

打开该目录中的终端并运行:$/配置

构建和安装:$make

安装包:$pip3安装package_name

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

匿名用户

如果您在Windows上使用anaconda,这对我很有用:

我尝试了许多其他的解决方案,但都不起作用(环境路径变量更改…)

此问题可能是由其他软件放置在Windows\System32文件夹中的dll(例如libcrypto-1_1-x64.dll或libssl-1_1-x64.dll或其他)引起的。

修复程序正在从安装openSSLhttps://slproweb.com/products/Win32OpenSSL.html它用更新的版本取代DLL。

匿名用户

如果您在Red Hat/CentOS上:

# To allow for building python ssl libs
yum install openssl-devel
# Download the source of *any* python version
cd /usr/src
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
tar xf Python-3.6.2.tar.xz 
cd Python-3.6.2

# Configure the build w/ your installed libraries
./configure

# Install into /usr/local/bin/python3.6, don't overwrite global python bin
make altinstall