avatar

目录
cent os升级python3.7

查看一下当前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
2
sudo make
sudo make install

创建软连接

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
文章作者: 止戈-
文章链接: http://vchamps.cn/2020/03/17/cent-os%E5%8D%87%E7%BA%A7python3-7/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Ever-Wu