先安装python到centos7
第一步:
安装必要的软件包,使用root权限:
yum groupinstall -y "Development tools"
yum install -y ncurses-devel gdbm-devel xz-devel sqlite-devel tk-devel uuid-devel readline-devel bzip2-devel libffi-devel
第二步:
Python官方地址:
本文安装Python3.10.6
新建目录并下载源码包并解压:
mkdir python
cd python
wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz
tar xzf Python-3.10.6.tgz
cd Python-3.10.6
第三步:
编译安装
./configure
make
make install
本文使用默认配置安装,安装后可执行文件在/usr/local/bin,将该目录添加至环境变量:
PATH=$PATH:$HOME/bin:/usr/local/bin
export PATH
重新载入环境变量:
source ~/.bash_profile
Python3.10.6安装完毕:
Python 3.10.6 (main, Sep 15 2022, 10:01:37) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
标签:bin,search,python,devel,Python,3.10,eureka,安装
From: https://www.cnblogs.com/xiaohanlin/p/17851059.html