admin管理员组

文章数量:1794759

linux安装python3步骤

linux安装python3步骤

1、安装前需要说明下,往往我们的linux环境已经安装了python2.7版本。

注:这个时候我们不需要把它卸载,不然后续很多编译操作可能会受影响。

#查看目前安装的python版本号 [root@test ~]# python -V Python 2.7.5 [root@test ~]# whereis python python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz [root@test ~]# [root@test ~]# ls -l /usr/bin/python* lrwxrwxrwx. 1 root root 7 Aug 13 2019 /usr/bin/python -> python2 lrwxrwxrwx. 1 root root 9 Aug 13 2019 /usr/bin/python2 -> python2.7 -rwxr-xr-x. 1 root root 7216 Jun 21 2019 /usr/bin/python2.7 [root@test ~]#

从上图可以看到/usr/bin/python和/usr/bin/python2都是软链接,/usr/bin/python指向/usr/bin/python2,而/usr/bin/python2又指向/usr/bin/python2.7,所以运行python/python2/python2.7的效果是一样的,其实都是在运行python2.7。

2、下载python安装包,官网地址:

本文标签: 步骤Linux