前提:

1、实现自动补全需要安装模块 readline-devel (yum install -y readline-devel)

2、实现支持SSL协议需安装模块 openssl-devel (yum install -y openssl-devel)

  否则使用pip时会有报错,如下

安装步骤

1、下载python3.5源码包到/usr/local/src/ (https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz)

2、 tar xf Python-3.5.2.tgz

  cd Python-3.5.2

  ./configure --prefix=/usr/local/python-3.5.2

  make && make >python_install.log

3、设置PATH(里面包含pip3) echo "PATH=$PATH:/usr/local/python-3.5.2/bin">>  /etc/profile.d/python.sh

4、设置默认python路径

  (1) which python    ----> /usr/bin/python

  (2) rm -rf /usr/bin/python

  (3) ln -s /usr/local/python3.5.2/bin/python /usr/bin/python

  (4) 修改/usr/bin/yum中python路径为/usr/bin/python2(yum中python只支持原python)

注释:因为python3.5.2中已安装了pip(python包管理工具),故不需要再安装

其他版本如没有安装pip,需要再安装,源码安装:需要先安装setuptools-28.8.0(python setup.py install),之后安装pip-9.0.1(python setup.py install)

具体安装内容参考:https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py

CentOS6.5源码安装python3.5.2的更多相关文章

  1. centos7源码安装Python3的前提条件

    centos7源码安装Python3的前提条件: # yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline- ...

  2. CentOS7 下源码安装 python3

    CentOS 7 下源码安装 python3   在CentOS7下,默认安装的是python2.7:为满足项目要求,安装python3 的方法如下:   1. 首先安装python3.6可能使用的依 ...

  3. CENTOS6.5源码安装LNMP

    CENTOS6.5源码安装LNMP 一.安装前准备 ########################################################################## ...

  4. CentOS6.5源码安装MySQL5.6.35

    CentOS6.5源码安装MySQL5.6.35 一.卸载旧版本 1.使用下面的命令检查是否安装有mysql [root@localhost tools]# rpm -qa|grep -i mysql ...

  5. 源码安装Python3

    源码安装Python3 一.安装Python3需要的依赖包 [root@localhost ~]# yum install -y gcc make wget openssl openssl-devel ...

  6. CentOS6.7源码安装MySQL5.6

    1.源码安装MySQL5.6 # CentOS6操作系统安装完成后,默认会在/etc目录下存在一个my.cnf, # 强制卸载了mysql-libs之后,my.cnf就会消失 rpm -qa | gr ...

  7. CentOS6下源码安装mysql-5.6.25

    1.1.系统环境检查 1)检查系统版本 mkdir -p /server/tools/ cd /server/tools/ cat /etc/redhat-release 2)配置域名解析 vim / ...

  8. Centos源码安装Python3

    CentOS7默认安装了python2.7.5,当需要使用python3的时候,可以手动下载Python源码后编译安装. 下载python(https://www.python.org/ftp/pyt ...

  9. Linux 源码安装 Python3

    下载源码包https://www.python.org/downloads/ 解压(以3.64版本为例)wget https://www.python.org/ftp/python/3.6.4/Pyt ...

随机推荐

  1. C#获取真实IP地址实现方法

    通常来说,大家获取用户IP地址常用的方法是: string IpAddress = ""; if((HttpContext.Current.Request.ServerVariab ...

  2. Linux 如何解决 xhost: unable to open display ""

    [root@host02 ~]# vncservice You will require a password to access your desktops. Password: Verify: x ...

  3. 每天一个 Linux 命令(15):tail 命令

    tail 命令从指定点开始将文件写到标准输出.使用tail命令的-f选项可以方便的查阅正在改变的日志文件,tail -f filename会把filename里最尾部的内容显示在屏幕上,并且不但刷新, ...

  4. Python 多线程

    一.线程的使用 需导入模块: from threading import Thread 二.基本使用 def fun1(arg1, v): print(arg1) print('before') t1 ...

  5. iptables删除规则

    查看nat规则: iptables -t nat -nL --line-number 添加规则是-A和-I,-A是添加到末尾,-I是添加到指定位置,默认添加到最前面.删除使用-D,也就是原来“ipta ...

  6. Python基础篇【第6篇】: Python模块subprocess

    subprocess Python中可以执行shell命令的相关模块和函数有: os.system os.spawn* os.popen*          --废弃 popen2.*         ...

  7. html基础 2

    HTML 文本格式化实例 (我不知道为什么“正常显示文本”这几个字不用加标签,虽然它有在<body>标签内) <html> <body> <b>文本为黑 ...

  8. 后台数据库读取Html值 到前台显示不了样式

    @Html.Raw(FieldValue) 像一些Html代码 传到前台编译不了,直接显示出来 FieldValue 是后台传过来的值 viewBag

  9. TENDA-F322路由器管理工具

    https://yunpan.cn/cYsfNxJLfVnUY (提取码:d0ae)

  10. js实现继承的两种方式

    这是面试时面试官会经常问到问题: js的继承方式大致可分为两种:对象冒充和原型方式: 一.先说对象冒充,又可分为3种:临时属性方式.call().apply(): 1.临时属性方式: 当构造对象son ...