美文网首页旅行·在路上
redhat安装python3.6.4

redhat安装python3.6.4

作者: 天涯梦难现 | 来源:发表于2019-07-29 17:25 被阅读1次

自定义下载地址:https://www.python.org/ftp/python/

首先通过命令wget下载安装包

image image.gif

下载完之后通过tar zxvf Python-3.6.4.tgz解压到指定文件夹

image image.gif

运行以下命令配置安装目录:

./configure --prefix=/usr/python3

安装到usr/python3文件夹下

系统自带的python是安装在/usr/bin/python

image image.gif

执行编译命令

make

执行安装命令

make install

以上命令是在root权限下执行的。

暗转的时候报错:

image image.gif

原因是缺少工具包

image image.gif

官网下载zlib,复制到相应的文件夹。

执行./configure

make

make install

三个命令即可安装好

然后重新编译和安装python3

安装结果:

image image.gif

查看是否安装成功

image image.gif

依然是系统自带的版本,系统自带的版本2.6.6是在、usr/bin/python下,python是一个软连接,我们也可新建一个软连接python3

建立软链接如下:

ln -s /usr/python3/bin/python3 /usr/bin/python3

image image.gif

安装成功

相关文章

网友评论

    本文标题:redhat安装python3.6.4

    本文链接:https://www.haomeiwen.com/subject/aacirctx.html