ITPub博客

首页 > 应用开发 > Python > linux下 Python3.11 版本安装

linux下 Python3.11 版本安装

原创 Python 作者:xingxintian 时间:2023-05-24 11:44:39 0 删除 编辑

下载官网3.11.3 的源码包。

wget https://www.python.org/ftp/python/3.11.3/Python-3.11.3.tgz


[ec2-user@ip-10-103-1-231 Python-3.11.3]$ ll

total 1360

-rw-r--r--  1 ec2-user ec2-user  24428 Apr  4 22:22 aclocal.m4

-rwxr-xr-x  1 ec2-user ec2-user  49348 Apr  4 22:22 config.guess

-rwxr-xr-x  1 ec2-user ec2-user  35276 Apr  4 22:22 config.sub

......

-rw-r--r--  1 ec2-user ec2-user  10028 Apr  4 22:22 README.rst

-rw-r--r--  1 ec2-user ec2-user  66207 Apr  4 22:22 setup.py

drwxr-xr-x 22 ec2-user ec2-user    312 Apr  4 22:22 Tools


[ec2-user@ip-10-103-1-231 Python-3.11.3]$ sudo ./configure --prefix=/usr/local/python3 --enable-optimizations --with-openssl=/usr/local/openssl11

checking build system type... x86_64-pc-linux-gnu

checking host system type... x86_64-pc-linux-gnu

checking for Python interpreter freezing... ./_bootstrap_python

checking for python3.11... no

checking for python3.10... no

checking for python3.9... no

......

checking for additional Modules/Setup files... 

checking for stdlib extension module _multiprocessing... yes

checking for stdlib extension module _posixshmem... yes

checking for stdlib extension module fcntl... yes

checking for stdlib extension module mmap... yes

checking for stdlib extension module _socket... yes

checking for stdlib extension module grp... yes

checking for stdlib extension module ossaudiodev... yes

checking for stdlib extension module pwd... yes

checking for stdlib extension module resource... yes

checking for stdlib extension module _scproxy... n/a

checking for stdlib extension module spwd... yes

checking for stdlib extension module syslog... yes

checking for stdlib extension module termios... yes

checking for stdlib extension module pyexpat... yes

checking for stdlib extension module _elementtree... yes

checking for stdlib extension module _md5... yes

checking for stdlib extension module _sha1... yes

checking for stdlib extension module _sha256... yes

checking for stdlib extension module _sha512... yes

checking for stdlib extension module _sha3... yes

checking for stdlib extension module _blake2... yes

checking for stdlib extension module _crypt... yes

checking for stdlib extension module _decimal... yes

checking for stdlib extension module _gdbm... yes

checking for stdlib extension module nis... yes

checking for stdlib extension module _sqlite3... yes

checking for stdlib extension module _tkinter... missing

checking for stdlib extension module _uuid... yes

checking for stdlib extension module zlib... yes

checking for stdlib extension module _bz2... yes

checking for stdlib extension module _lzma... yes

checking for stdlib extension module _ ssl... yes

checking for stdlib extension module _hashlib... yes

checking for stdlib extension module _testcapi... yes

checking for stdlib extension module _testclinic... yes

checking for stdlib extension module _testinternalcapi... yes

checking for stdlib extension module _testbuffer... yes

checking for stdlib extension module _testimportmultiple... yes

checking for stdlib extension module _testmultiphase... yes

checking for stdlib extension module _xxtestfuzz... yes

checking for stdlib extension module _ctypes_test... yes

checking for stdlib extension module xxlimited... yes

checking for stdlib extension module xxlimited_35... yes

configure: creating ./config.status

config.status: creating Makefile.pre

config.status: creating Misc/python.pc

config.status: creating Misc/python-embed.pc

config.status: creating Misc/python-config.sh

config.status: creating Modules/Setup.bootstrap

config.status: creating Modules/Setup.stdlib

config.status: creating Modules/ld_so_aix

config.status: creating pyconfig.h

configure: creating Modules/Setup.local

configure: creating Makefile


sudo make && make install                             

Running code to generate profile data (this can take a while):                                                                    

# First, we need to create a clean build with profile generation                                                                  

# enabled.                                                                                                                        

make profile-gen-stamp                                                                                                            

……

rm -f /app/Python3/share/man/man1/python3.1                                                                                       

(cd /app/Python3/share/man/man1; ln -s python3.11.1 python3.1)                                                                    

if test "xupgrade" != "xno"  ; then \                                                                                             

        case upgrade in \                                                                                                         

                upgrade) ensurepip="--upgrade" ;; \                                                                               

                install|*) ensurepip="" ;; \                                                                                      

        esac; \                                                                                                                   

         ./python -E -m ensurepip \                                                                                               

                $ensurepip --root=/ ; \                                                                                           

fi                                                                                                                                

Looking in links: /tmp/tmpih0inerq                                                                                                

Requirement already satisfied: setuptools in /app/Python3/lib/python3.11/site-packages (65.5.0)                                   

Requirement already satisfied: pip in /app/Python3/lib/python3.11/site-packages (23.0.1)                                          

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager.

 It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv


最后在/etc/profile中增加PATH的环境变量即可



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28538954/viewspace-2954206/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2013-03-01

  • 博文量
    21
  • 访问量
    77524