查看一下当前python的版本
bash
1 | whereis python |
下载python
bash
1 | wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz |
解压安装包
bash
1 | tar -xvf Python-3.7.3.tgz |
安装依赖
bash
1 | sudo yum install -y openssl-devel openssl-static zlib-devel lzma tk-devel xz-devel bzip2-devel ncurses-devel gdbm-devel readline-devel sqlite-devel gcc libffi-devel |
将解压文件夹移至 /usr/local
bash
1 | sudo mv Python-3.7.3 /usr/local |
进入python3.7目录
bash
1 | cd /usr/local/Python-3.7.3 |
执行配置文件
bash
1 | ./configure |
编译安装
bash
1 | sudo make |
创建软连接
bash
1 | sudo ln -s /usr/local/Python-3.7.3/python /usr/bin/python3 |
进入python pip3
bash
1 | python3 |
bash
1 | pip3 |
pip3安装模块
bash
1 | pip3 install model-name --user |