centos7 中 安装python 11

 

001、查看系统

[root@PC1 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

 

 

002、安装环境依赖

 

yum -y install gcc install zlib zlib-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel uuid-devel libffi libffi-devel
yum -y install gcc epel-release
yum -y install openssl-devel openssl11 openssl11-devel
export CFLAGS=$(pkg-config --cflags openssl11)
export LDFLAGS=$(pkg-config --libs openssl11)

 

003、下载最近python安装包、并编译

wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz
tar -xzvf Python-3.11.1.tgz
cd Python-3.11.1/
./configure
make
make install

 

 

注:有一个模块_tkinter一直安装不上,目前未找到原因。

 

004、测试python命令

[root@PC1 Python-3.11.1]# ./python --version
Python 3.11.1

 

posted @ 2023-01-02 23:05  小鲨鱼2018  阅读(487)  评论(0编辑  收藏  举报