前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >2019-07-09 CentOS7 安

2019-07-09 CentOS7 安

作者头像
py3study
发布2020-01-06 15:11:13
2860
发布2020-01-06 15:11:13
举报
文章被收录于专栏:python3python3

在CentOS7上默认安装的是python2.7版本,而使用yum install python34安装的是3.4版本,这个版本在安装一些软件包如pip的时候会提示:

代码语言:javascript
复制
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).

自然我们想安装高版本,需要手动安装。 1.下载python3 试用3.8使用下面链接

代码语言:javascript
复制
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0b2.tgz

3.7.4使用下面链接

代码语言:javascript
复制
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4rc2.tgz

2.编译安装:

代码语言:javascript
复制
tar -zxvf Python-3.8.0b2.tgz
mkdir /usr/local/python3
#如果没有编译环境,会有错误提示,修复的办法是安装gcc或者工具套件
[root@ax Python-3.8.0b2]# ./configure --prefix=/usr/local/python3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.8... no
checking for python3... no
checking for python... python
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/axing/Python-3.8.0b2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[root@ax Python-3.8.0b2]# yum -y groupinstall "Development Tools"
#装完后重新编译
cd Python-3.8.0b2
./configure --prefix=/usr/local/python3
make && make install
#设置软链接
[root@ax-3.8.0b2]# ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
[root@ax]# python3
Python 3.8.0b2 (default, Jul  8 2019, 12:01:59)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-09-25 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档