pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail

Posted jwentest

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail相关的知识,希望对你有一定的参考价值。

# 背景

安装pip后发现执行pip install pytest,提示下面错误

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

 

# 解决方法

查询了资料,大概意思是,新版的pip默认要使用SSL,可以通过设置修改,但木有发现pip.conf文件在哪里,囧rz,后续再研究下

但找到另外一个解决方法

先安装openssl-dev,然后重新编译安装,只是在编译的过程中加入 --enable-optimizations

具体如下:

sudo yum install openssl-dev

然后:
./configure --enable-optimizations
make && make install

这样就可以了的 

 

实际上解决方法挺多的

1. 修改pip.conf

2. 修改安装目录下module下的setup文件

3. 安装openssl后,编译时加上--enable-optimizations

以上是关于pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail的主要内容,如果未能解决你的问题,请参考以下文章

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not 解决方法(

搭建docker-python环境时提示WARNING: pip is configured with locations that require TLS/SSL, however the ssl

搭建docker-python环境时提示WARNING: pip is configured with locations that require TLS/SSL, however the ssl(

DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no

Configuration ‘androidTestCompile‘ is obsolete and has been replaced with ‘androidTestImplementation

configure: error: /usr/include/openssl is a bad --with-openssl prefix