1.环境

安装CentOS 7.2最小系统(CentOS-7-x86_64-Minimal-1511.iso)

2.需求

Python-3.6.4.tar.xz(官网下载)

GCC(yum安装)

一堆开发库(yum安装)

3.编译

3.1安装编译器

yum -y install gcc

3.2安装依赖

yum -y install bzip2-devel sqlite-devel openssl-devel readline-devel xz-devel xz-devel tk-devel gdbm-devel

3.3编译源码

tar Jxvf Python-3.6..tar.xz

cd Python-3.6.

./configure

(如果需要发布版,则配置时要开优化,编译较慢./configure --enable-optimizations)
make -j4

// 注意: 源码编译安装后不好卸载,没有make uninstall这种命令,暂时没找到好的方案,有知道的可以留言哈。 -- 2018年6月22日 nidey
make install

默认安装到/usr/local

注意如果不安装3.2依赖开发库,则编译完成后会提示有些模块没有编译

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _lzma
_sqlite3 _ssl _tkinter
readline zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit pwd time
running build_scripts

4.运行

[root@py3 Python-3.6.]# python3
Python 3.6. (default, Jan , ::)
[GCC 4.8. (Red Hat 4.8.-)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

CentOS 7.2 源码安装Python3.6的更多相关文章

  1. CentOS7 下源码安装 python3

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

  2. CentOS 7下源码安装MySQL 5.7

    网上说linux安装mysql服务分两种安装方法: ①源码安装,优点是安装包比较小,只有几十M左右,缺点是安装依赖的库多,安装编译时间长,安装步骤复杂容易出错: ②使用官方编译好的二进制文件安装,优点 ...

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

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

  4. centos 6.4 源码安装php5.4 mysql5.5 apahce2

    centos 6.4 源码安装php5.4 mysql5.5 apahce2 博客分类: php   参考:http://blog.csdn.net/simpleiseasy/article/deta ...

  5. 源码安装Python3

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

  6. CentOS 7下源码安装MySQL 5.6

    本文转载,并非原创. 目录 准备工作 运行环境 确认你的安装版本 下载MySQL 安装MySQL 准备安装环境 编译和安装 配置MySQL 单实例配置 单实例配置方法 添加防火墙 启动MySQL 重启 ...

  7. CentOS6.5源码安装python3.5.2

    前提: 1.实现自动补全需要安装模块 readline-devel (yum install -y readline-devel) 2.实现支持SSL协议需安装模块 openssl-devel (yu ...

  8. centos精简系统 源码安装客户端git

    CentOS的yum源中git版本比较低,需要最新版本git,只能自己编译安装,现在记录下编译安装的内容,留给自己备忘. 对于精简型的centos系统,会缺少很多依赖包和插件,要源码安装客户端git, ...

  9. CentOS 6.4 源码安装MySQL 5.6

    1.安装前准备工作 1.1 必备的包 gcc/g++ :MySQL 5.6开始,需要使用g++进行编译.cmake :MySQL 5.5开始,使用cmake进行工程管理,cmake需要2.8以上版本. ...

随机推荐

  1. 大数据学习——Linux-SSH报错:Could not resolve hostname centos02: Temporary failure in name resolution

    https://blog.csdn.net/mcb520wf/article/details/83303792 随笔异常 ssh: Could not resolve hostname centos0 ...

  2. Spring使用JdbcTemplate实现对数据库操作

    https://www.cnblogs.com/tuhooo/p/6491913.html https://blog.csdn.net/maodoubi/article/details/4826723 ...

  3. CDOJ 1217 The Battle of Chibi

    The Battle of Chibi Time Limit: 6000/4000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Othe ...

  4. Computer (树形DP)

    A school bought the first computer some time ago(so this computer's id is 1). During the recent year ...

  5. POJ-1061青蛙的约会,扩展欧几里德求逆元!

                                                               青蛙的约会 以前不止一次看过这个题,但都没有去补..好吧,现在慢慢来做. 友情提示 ...

  6. Go内建变量类型

    package main import ( "math/cmplx" "fmt" "math" ) //内建变量类型: // bool , ...

  7. kubernetes集群新增node

    kubernetes集群要新增node,首先要配置ssh免密登陆 root@ht:/etc/ansible# ssh-copy-id 172.18.196.6 /usr/bin/ssh-copy-id ...

  8. noip 2010 数字统计

    数位dp解水题 luogu1179 dp[i][j]表示 有i位,且首位是j(包括0) 的 ‘2’的个数 dp[i][j]={ Σ(dp[i-1][k]),j!=2; Σ(dp[i-1][k])+va ...

  9. 运行hadoop自带的计算圆周率异常

    运行hadoop2 自带的圆周率计算方法时,报错,找了半天,原来是在配置hadoop临时目录时,没有给权限,找到配置的hadoop临时目录文件夹,修改权限即可 Application applicat ...

  10. hdu 1496 hash

    hash?判重,是否一样?相等?等式!没有想到,这次题做玩后,学到了HASH这一功能!当数据量在数组允许大小范围内时候即可!判断等式俩边是否相等,从而获得解的个数!从复杂度,n*m*k****,降到 ...