源码安装python3
程序员文章站
2024-02-23 17:26:28
...
这里安装的是python3.9
安装python3.9.0
安装开发工具
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
安装python
wget -c https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
tar -xzvf Python-3.9.0.tgz && cd Python-3.9.0
./configure --prefix=/usr/local/lib/python3.9
make && make install
验证是否可用
cd /usr/local/lib/python3.9
修改pip3的软连接
修改python3的软连接
ln -s /usr/local/lib/python3.9/bin/python3 /usr/bin/python3
ln -s /usr/local/lib/python3.9/bin/pip3 /usr/bin/pip3
相同版本的依赖,只要直接复制到对应位置即可。
pip3 install pymysql
上一篇: grep常见用法
下一篇: 【Linux】grep常见用法