ubuntu安装指定python版本,且多版本并行遇到的问题

一、遇到的问题:

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/simple

2.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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hi,heng

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值