|
|
centos 9 stream安装python3.12版本 方法:: y/ V2 c( z" D3 H
下载python# K# C+ Q% L3 o" e2 N) r! o/ C
wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz& O# a" N! n+ V4 ^
# |" R& x' o$ v& U6 s
解压: j) G9 ] o0 p5 c3 Q1 t% a9 T
tar -zxvf Python-3.12.0.tgz 2 ~% |, R! _( G5 T6 Y0 E# E
2 f( C* _8 h6 v( ?4 V- P( d
配置:, C; G, E2 I0 |3 X+ g
cd Python-3.12.0/: C; s8 {; Y, L
7 w1 a4 N* U& s
1 M! k/ ?4 z6 [- b2 H
安装依赖:
2 ]: S9 f8 S3 B0 Z
) }! Y9 }8 Y# b& J
! M: Z, O0 m+ ]; X0 S3 mdnf -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libpcap-devel xz-devel libffi-devel
/ \8 A7 q) m& {, `% d+ wdnf install -y gcc gcc-c++. J8 X$ `5 k \' E( w- \
( }9 H% R$ A N# `) ]( V4 |
( W$ i s Q; Y; c/ a: u
使用configure 配置:2 Y, M" x" i' d4 w' f
7 p& E: x, s# E8 A7 p! B
./configure --prefix=/usr/local/python312 --enable-optimizations --enable-framework --enable-big-digits --enable-loadable-sqlite-extensions --enable-pystats --enable-profiling --enable-universalsdk --enable-FEATURE
0 o$ Y, b( x; S3 j
" U z* h6 G' N0 e( Cmake * u# O( F3 x; o
make install7 D! W4 T# U5 Z3 B
. n7 x8 x8 w7 j
[root@python-flask bin]# ln -s /usr/local/python312/bin/python3.12 /usr/bin/python3.12
0 D( e" _8 Z4 H" g. a) s& E% X' l* I9 q# y6 Z( P9 a
[root@python-flask bin]# ln -s /usr/local/python312/bin/pip3.12 /usr/bin/pip
7 e, l- x# u. I; A- |0 ^4 {5 F
- @* W+ J; n5 x5 E% s9 y8 \% \ ?6 o' x7 q
7 N, M9 H/ T1 h0 w, o4 M' \7 u4 A
$ [2 S# a$ Z& ~1 R" L5 b8 a2 ~ o% J. S: T- p
|
|