码迷,mamicode.com
首页 > 编程语言 > 详细

安装python3.5

时间:2019-12-14 09:47:32      阅读:96      评论:0      收藏:0      [点我收藏+]

标签:oop   http   查看   目录   usr   lin   删除   python   adl   

安装python3.5可能使用的依赖

[root@heweiwei heweiwei]# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

到python官网找到下载路径, 用wget下载

[root@heweiwei heweiwei]# wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

解压tgz包

[root@heweiwei heweiwei]# tar -zxvf Python-3.5.1.tgz

把python移到/usr/local下面

[root@heweiwei heweiwei]# mv Python-3.5.1 /usr/local

删除旧版本的python依赖

[root@heweiwei heweiwei]# ll /usr/bin | grep python
-rwxr-xr-x. 1 root root 20152 May 12 2016 abrt-action-analyze-python
-rwxr-xr-x. 2 root root 9032 Au 大专栏  安装python3.5g 18 2016 python
lrwxrwxrwx. 1 root root 6 Feb 27 16:05 python2 -> python
-rwxr-xr-x. 2 root root 9032 Aug 18 2016 python2.6
-rwxr-xr-x. 1 root root 1418 Aug 18 2016 python2.6-config
lrwxrwxrwx. 1 root root 16 Feb 28 17:21 python-config -> python2.6-config

[root@heweiwei heweiwei]# rm -rf /usr/bin/python

进入python目录
[root@heweiwei heweiwei]# cd /usr/local/Python-3.5.1/
[root@heweiwei Python-3.5.1]#

配置

[root@heweiwei Python-3.5.1]# ./configure

编译 make

[root@heweiwei Python-3.5.1]# make

编译,安装

[root@heweiwei Python-3.5.1]# make install

删除旧的软链接,创建新的软链接到最新的python

[root@heweiwei Python-3.5.1]# rm -rf /usr/bin/python
[root@heweiwei Python-3.5.1]# ln -s /usr/local/bin/python3.5 /usr/bin/python

查看版本

[heweiwei@heweiwei ~]$ python -V
Python 3.5.1

安装python3.5

标签:oop   http   查看   目录   usr   lin   删除   python   adl   

原文地址:https://www.cnblogs.com/lijianming180/p/12037961.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!