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

# 背景

安裝pip後發現執行pip install pytest,提示下面錯誤ui

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

 

# 解決方法

查詢了資料,大概意思是,新版的pip默認要使用SSL,能夠經過設置修改,但木有發現pip.conf文件在哪裏,囧rz,後續再研究下spa

但找到另一個解決方法code

先安裝openssl-dev,而後從新編譯安裝,只是在編譯的過程當中加入 --enable-optimizationsblog

具體以下:ip

sudo yum install openssl-devel

而後:
./configure --enable-optimizations
make && make install

這樣就能夠了的 ssl

 

實際上解決方法挺多的openssl

1. 修改pip.confit

2. 修改安裝目錄下module下的setup文件pip

3. 安裝openssl後,編譯時加上--enable-optimizationsio

相關文章
相關標籤/搜索