centos7 32bit安装python3.10的坑

文章详细描述了解决pip安装过程中遇到的SSL模块不可用的问题,通过安装依赖包、编译并安装openssl1.1.1g版本,以及编译安装Python3.10.6并指定openssl路径。最终成功安装并验证了Python版本。
摘要由CSDN通过智能技术生成

坑了我好久,终于安装成功了,

pip install requests就提示错误 

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

 网上教程很多, 但是几乎无用。

1. 安装依赖包

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

2. 安装openssl选择openssl 1.1.1g这个后面字母要是g的版本, 其他字母版本无用。

cd /usr/local/src
wget https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1g.tar.gz
tar -zxvf openssl-OpenSSL_1_1_1g.tar.gz
cd openssl-OpenSSL_1_1_1g/
./config --prefix=/usr/local/openssl
make && make test && make install
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib/
ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib/
openssl version


sudo vim /etc/ld.so.conf #打开文件,把/usr/local/openssl/lib加的文件最后:

sudo ldconfig -v #设置生效


 

 

3. 

wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz
tar -zxvf Python-3.10.6.tgz
cd Python-3.10.6/
./configure --prefix=/usr/local/python3.10 --with-openssl=/usr/local/openssl_1.1

随后修改代码包中的Modules/Setup文件

4.  然后在安装python3

make
make install
ln -s /usr/local/python3/bin/python3.10 /usr/bin/python
ln -s /usr/local/python3/bin/pip3.10 /usr/bin/pip
python -V

终于是成功了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

na94_dev

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

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

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

打赏作者

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

抵扣说明:

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

余额充值