日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

python3.7安装pip问题_python3.7安装, 解决pip is configured with locations that require TLS/SSL问题...

發(fā)布時(shí)間:2025/3/20 python 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python3.7安装pip问题_python3.7安装, 解决pip is configured with locations that require TLS/SSL问题... 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.安裝相關(guān)依賴

yum install gcc libffi-devel zlib* openssl-devel

# libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

2.下載并解壓

wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz

# 下載

wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz

# 解壓并編譯:

tar -xvJf Python-3.7.1.tar.xz

cd Python-3.7.1

3.編譯安裝

./configure prefix=/usr/local/python3

make && make install

# 編譯完成后,創(chuàng)建軟鏈接文件到執(zhí)行文件路徑:

ln -s /usr/local/python3/bin/python3 /usr/bin/python3

ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

# 我們可以清除之前編譯的可執(zhí)行文件及配置文件 && 清除所有生成的文件:

make clean && make distclean

bug: 使用pip 命令失敗

2.1 錯(cuò)誤信息

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

Collecting virtualenv

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/

Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/

Could not fetch URL https://pypi.org/simple/virtualenv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/virtualenv/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

Could not find a version that satisfies the requirement virtualenv (from versions: )

No matching distribution found for virtualenv

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

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

2.2 原因

系統(tǒng)版本centos6.5,其中openssl的版本為OpenSSL 1.0.1e-fips 11 Feb 2013,而python3.7需要的openssl的版本為1.0.2或者1.1.x,需要對openssl進(jìn)行升級,并重新編譯python3.7.0。yum 安裝的openssl 版本都比較低。

2.3 升級openssl

# 1.下賊openssl

wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz

tar -zxvf openssl-1.1.1a.tar.gz

cd openssl-1.1.1a

# 2.編譯安裝

./config --prefix=/usr/local/openssl no-zlib #不需要zlib

make

make install

# 3.備份原配置

mv /usr/bin/openssl /usr/bin/openssl.bak

mv /usr/include/openssl/ /usr/include/openssl.bak

# 4.新版配置

ln -s /usr/local/openssl/include/openssl /usr/include/openssl

ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/local/lib64/libssl.so

ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

# 5.修改系統(tǒng)配置

## 寫入openssl庫文件的搜索路徑

echo "/usr/local/openssl/lib" >> /etc/ld.so.conf

## 使修改后的/etc/ld.so.conf生效

ldconfig -v

# 6.查看openssl版本

openssl version

openssl version 提示:

/usr/local/openssl/bin/openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

假如你的libssl.so.1.1 文件在/usr/local/openssl/lib/下面,可以這樣做

ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1

ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1

3.3 重新安裝python

./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl

make

make install

原文:https://blog.csdn.net/lkgCSDN/article/details/84403329

總結(jié)

以上是生活随笔為你收集整理的python3.7安装pip问题_python3.7安装, 解决pip is configured with locations that require TLS/SSL问题...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。