一、遇到的问题:
1.Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
解决方法:
sudo apt update# 更新apt
sudo apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev liblzma-dev libffi-dev libc6-dev
2.pip is configured with locations that require TLS/SSL
1.可参考这位大佬的解决办法:直接跳
2.pip config set global.extra-index-url http://mirrors.aliyun.com/pypi/simple2.1编辑文件:vim /root/.config/pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple
[install]
trusted-host = mirrors.aliyun.com
3.openssl: relocation error: openssl: symbol EVP_mdc2 version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference
如果查询版本
vim /etc/ld.so.conf.d/libc.conf
增加:/usr/lib
4.ubuntu无法添加PPA的解决办法
可参考这位大佬的解决办法:直接跳
5发现出现大量证书验证失败的请求
可参考这位大佬的解决办法:直接跳
二、安装教程
遇到了一系列的问题,最后参考了这篇文章完成了安装:直接跳
1.下载及编译、安装可以参考这篇文章
2.多版本并行可以参考这边文章:
三、安装完成后,少这少哪依赖的解决方案
1.ModuleNotFoundError: No module named '_ctypes
apt install libffi-dev
安装完,重新编译python
切到python 编译的目录 make && make install
2.ModuleNotFoundError: No module named ‘_ssl’
到网上找教程openssl-1.1.1n 下载安装后,重新再编译一遍python
./configure
make && make install