关于python:linux-安装python3

41次阅读

共计 477 个字符,预计需要花费 2 分钟才能阅读完成。

1 装置依赖包

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 gcc

2 下载解压 Python3.7

# 2 下载
wget http://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
# 3 解压
tar -xvf Python-3.7.1.tar.xz 
# 4 切换目录
cd Python-3.7.1

3 执行配置文件,编译,装置

mkdir /usr/local/python3
./configure --prefix=/usr/local/python3
make
make install

4 建设软连贯

ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3

正文完
 0