1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| # 安装python3
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_version="3.10.6"
mkdir /opt/python3
cd /usr/local/src
wget https://www.python.org/ftp/python/${python_version}/Python-${python_version}.tgz
tar xf Python-${python_version}.tgz
cd Python-${python_version}
# 编译安装
./configure --prefix=/opt/python3 \
--with-openssl=/opt/openssl \
--with-openssl-rpath=/opt/openssl/lib
make -j4
make altinstall
# 安装numpy
./python3.10 -m pip install numpy
# 安装pandas
./python3.10 -m pip install pandas
# 安装statsmodels
./python3.10 -m pip install statsmodels
|