linux离线安装python3.7教程_Linux傻瓜式七步完美安装Python3.7

发布于:2023-07-27 ⋅ 阅读:(207) ⋅ 点赞:(0)

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

# 1 首先切换到桌面

cd /home

# 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 执行配置文件,编译,安装

./configure --prefix=/usr/local/python37

make

make install

4 建立软连接

mv /usr/bin/python /usr/bin/python_bak

ln -s /usr/local/python37/bin/python3.7 /usr/bin/python

ln -s /usr/local/python37/bin/pip3.7 /usr/bin/pip

5 测试

# python

Python 3.7.1 (default, Jan 14 2019, 10:30:01)

[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux

Type "help", "copyright", "credits" or


网站公告

今日签到

点亮在社区的每一天
去签到