Centos 6.9 install Python3.7

本文提供了一种在CentOS上安装Python 3.7的方法,并详细介绍了安装过程中所需的依赖库,包括openssl及相关的开发库。通过本教程,读者可以了解如何配置环境并完成Python 3.7的安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

# install python3
sudo yum -y update
sudo yum -y install yum-utils

yum install -y zlib-devel bzip2-devel ncurses-devel
yum install libffi-devel
sqlite-devel wget
wget https://www.openssl.org/source/openssl-1.1.1b.tar.gz
tar xvf openssl-1.1.1b.tar.gz
cd openssl-1.1.1b
./config
make
make install
# openssl will be installed to /usr/local/ssl

# please add the path /usr/local/lib64 to /etc/ld.so.conf and run ldconfig
vi /etc/ld.so.conf
# add /usr/local/lib64
ldconfig
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar xzf Python-3.7.3.tgz
cd Python-3.7.3
vi Modules/Setup.dist
# uncomment the following lines
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
# :SSL=/usr/local/ssl
#  _ssl _ssl.c \
#     -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
#     -L$(SSL)/lib -lssl -lcrypto
./configure --enable-optimizations
make altinstall

转载于:https://www.cnblogs.com/Jerryshome/p/10671515.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值