系统环境
centos8修改镜像源
uname -r
4.18.0-193.el8.x86_64
部署依赖包
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel gcc make -y
查看openssl包
python3.10要求openssl版本1.1.1以上
openssl version
OpenSSL 1.1.1k FIPS 25 Mar 2021
创建python安装目录
mkdir /usr/local/python3.10
下载并解压python3.10包
cd /tmp
wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
tar -xvf Python-3.10.0.tgz
执行配置文件
cd /tmp/Python-3.10.0
./configure --prefix=/usr/local/python3.10
./configure --enable-optimizations
编译并安装程序
make && make install
查看python版本
python3 --version
Python 3.10.0
查看pip版本
pip3 --version
pip 21.2.3 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)
升级pip版本
pip3 install --upgrade pip
pip3 --version
pip 22.0.4 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)
安装python包
pip3 install pymysql
pip3 install cx_oracle
pip3 install numpy
pip install pymongo
pip3 list
安装Oracle即时客户端
centos安装Oracle即时客户端
测试Python
[root@centos8new ~]
Python 3.10.0 (default, Apr 1 2022, 22:31:10) [GCC 8.5.0 20210514 (Red Hat 8.5.0-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymysql
>>> import pymongo
>>> import numpy
|