今日因为部分程序需要用到paramiko模块,于是进行安装该模块,因为python版本比较老了,于是更新了最新的python3.9.0的版本,然后pip3.9 install paramiko的时候报错了,详细信息如下:
pip3.9 install paramiko
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: 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/paramiko/
WARNING: 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/paramiko/
WARNING: 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/paramiko/
WARNING: 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/paramiko/
WARNING: 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/paramiko/
Could not fetch URL https://pypi.org/simple/paramiko/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/paramiko/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement paramiko (from versions: none)
ERROR: No matching distribution found for paramiko
WARNING: 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
看信息是因为SSL的问题,根据这个问题可以看出来,应该是openssl的问题导致的,安装 openssl openssl-devel模块。
yum -y install openssl openssl-devel
已安装:
openssl-devel-1:1.1.1g-11.el8.x86_64 keyutils-libs-devel-1.5.10-6.el8.x86_64 krb5-devel-1.18.2-5.el8.x86_64 libcom_err-devel-1.45.6-1.el8.x86_64 libkadm5-1.18.2-5.el8.x86_64
libselinux-devel-2.9-4.el8_3.x86_64 libsepol-devel-2.9-1.el8.x86_64 libverto-devel-0.3.0-5.el8.x86_64 pcre2-devel-10.32-2.el8.x86_64 pcre2-utf32-10.32-2.el8.x86_64
zlib-devel-1.2.11-16.el8_2.x86_64
完毕!
安装以后,重新安装python3.9.0
./configure --prefix=/data/program/python3.9 --enable-optimizations
make && make install
安装成功后再执行
pip3.9 install paramiko
安装成功,大功告成。