1. 程式人生 > >pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

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

make 重新 test however con conf ins ava OS

# 背景

安裝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 available.