发布时间:2019-08-24 09:20:52编辑:auto阅读(1741)
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:裁剪图片
48901
47985
38759
35892
30319
27088
26099
20934
20752
19113
594°
671°
662°
668°
640°
611°
692°
756°
883°
1043°