发布时间:2019-08-24 09:20:52编辑:auto阅读(2071)
centos安装python3
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
2) 下载python3安装包
[root@python tools]# wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
3) 解压
[root@python tools]# tar xvzf Python-3.7.4.tgz
4) 创建文件夹把python3安装在里面
[root@python tools]# mkdir -p /usr/local/python3
[root@python tools]# cd Python-3.7.4
[root@python Python-3.7.4]# ./configure --prefix=/usr/local/python3/
[root@python Python-3.7.4]# make && make install
5) 建立软连接
[root@python Python-3.7.4]# ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
[root@python Python-3.7.4]# ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
6) 验证和测试
[root@python Python-3.7.4]# python3
Python 3.7.4 (default, Jul 26 2019, 04:16:54)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
上一篇: Python 表格打印
下一篇: Python:裁剪图片
52033
51891
42126
38975
33471
30424
29057
24084
23999
22347
74°
113°
128°
117°
137°
134°
154°
171°
172°
176°