目录
Centos、Rocky
离线包下载地址
https://www.python.org/downloads
右键复制地址链接
wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz
安装yum依赖
yum install zlib zlib-devel openssl-devel libffi-devel bzip2-devel make gcc -y
解压压缩包
tar -zxvf Python-3.12.0.tgz
编译安装
- cd Python-3.12.0/
- ./configure --with-ssl --prefix=/usr/local/lib/python3.12
- make
- make install
- /usr/local/lib/python3.12/bin/python3 -V
- /usr/local/lib/python3.12/bin/pip3 -V
rm -rf /usr/local/lib/python3.12
- yum install virtualenv -y
- 或
- pip install virtualenv
个人选择的第一种方式
- /usr/local/lib/python3.12 -m venv datamanageenv
- source datamanageenv/bin/activate
验证
- datamanageenv/bin/python3 -m pip download -d packages/pip confluent_kafka
-
- ...
- Successfully downloaded confluent_kafka
rm -rf datamanage