Python3.10.6安装

2023-12-24 22:45:48

文章目录


  • Python3.10.6安装

相关命令

## 1. 下载安装包
wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz

## 2. 安装依赖
yum install -y gcc patch libffi-devel python-devel  zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

## 3. 编译安装 python3
tar -zxf Python-3.10.6.tgz
cd Python-3.10.6
./configure --prefix=/usr/local/python3/
make -j 10 && make install

## 4. 将python3添加到环境变量
vim /etc/profile
PATH=/usr/local/python3/bin:$PATH

source /etc/profile

##5. 创建符号链接指向python3
mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/local/python3/bin/python3 /usr/bin/python
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip

The End.


文章来源:https://blog.csdn.net/seaneer/article/details/135172031
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。