CentOS7 下源码安装 python3
1. 首先安装python3.6可能使用的依赖
# yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel zlib-devel
# wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
# tar -zxvf Python-3.6.4.tgz
# cd Python-3.6.4
# ./configure --prefix=/usr/local/python36
# make && make altinstall
# mv /usr/bin/python /usr/bin/python.old
# ln -sv /usr/local/python36/bin/python3.6 /usr/bin/python
# ln -sv /usr/local/bin/python3.6 /usr/bin/python
# ln -sv /usr/local/bin/python3.6 /usr/bin/python3 # python -V
Python 3.6.4
# vim /usr/bin/yum
#!/usr/bin/python2.7
也可以安装一个tree测试一下
# yum -y install tree
如果出现报错:File “/usr/libexec/urlgrabber-ext-down”, line 28
[root@localhost ~]# ls -l /usr/bin/yum*
-rwxr-xr-x 1 root root 802 Feb 12 15:38 /usr/bin/yum
-rwxr-xr-x 1 root root 9429 Aug 11 2017 /usr/bin/yum-builddep
-rwxr-xr-x 1 root root 9039 Aug 11 2017 /usr/bin/yum-config-manager
-rwxr-xr-x 1 root root 7609 Aug 11 2017 /usr/bin/yum-debug-dump
-rwxr-xr-x 1 root root 7903 Aug 11 2017 /usr/bin/yum-debug-restore
-rwxr-xr-x 1 root root 10999 Aug 11 2017 /usr/bin/yumdownloader
修改 vim /usr/libexec/urlgrabber-ext-down 文件,将 /usr/bin/python 改为 /usr/bin/python2.7 即可! 这样,yum安装软件的时候就不会报错了,而且默认安装的就是python3了,输入python时,就会进入python3界面,如果想进入python2,那么就输入python2或python2.7 即可!
CentOS7 下源码安装 python3的更多相关文章
- CentOS7下源码安装mysql5.6
目录 准备工作 运行环境 确认你的安装版本 下载mysql 安装mysql 准备安装环境 编译和安装 配置mysql 单实例配置 单实例配置方法 添加防火墙 ...
- CentOS7下源码安装5.6.23
清理CentOS7下的MariaDB. [root@localhost ~]#rpm -qa | gremp mariadb [root@localhost ~]# rpm -e --node ...
- 国产化设备鲲鹏CentOS7上源码安装Python3.7
具体编译过成与正常的Python源代码在x86平台上的过程无异,此篇随笔仅当用作复制黏贴的备忘录.不得不说在一个老旧系统上安装一个老旧的Python版本,从头编译一个Python还是一个较为稳健的选择 ...
- centos7下源码安装mysql5.7.16
一.下载源码包下载mysql源码包 http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.16.tar.gz 二.安装约定: 用户名:mysql 安装目录 ...
- centos7下源码安装多个nginx步骤完整版
1.下载:wget http://nginx.org/download/nginx-1.10.0.tar.gz 解压:tar -zxvf nginx-1.10.0.tar.gz 2. 执行下面 ...
- nginx在Centos7.5下源码安装和配置
安装nginx 安装nginx依赖包 yum install -y pcre-devel zlib-devel openssl-devel wget gcc tree vim 进入目录/root/se ...
- 在ConoHa上Centos7环境下源码安装部署LNMP
本文记录了从源码,在Centos 7上手动部署LNMP环境的过程,为了方便以后对nginx和mariadb进行升级,这里采用yum的方式进行安装. 1.建立运行网站和数据库的用户和组 groupadd ...
- centos7源码安装Python3的前提条件
centos7源码安装Python3的前提条件: # yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline- ...
- CentOS7.3环境下源码安装httpd
CentOS7.3环境下源码安装httpd 本文在CentOS7.3下,源码安装apache服务httpd2.4. 1.下载好源码安装包 [root@localhost ~]#ll total 625 ...
随机推荐
- 第二十三节:Java语言基础-详细讲解函数与数组
函数 函数在Java中称为方法,在其他语言中可能称为函数,函数,方法就是定义在类中具有特定功能的程序.函数,在Java中可称为方法. 函数的格式: 修饰符 返回值类型 函数名(参数类型 参数1, 参数 ...
- Java学习笔记38(字符流)
字符输出流:Writer类:使用时候需要它的子类 局限性:只能写文本文件,无法写其他文件 方法: package demo; import java.io.FileWriter; import jav ...
- LeetCode:105_Construct Binary Tree from Preorder and Inorder Traversal | 根据前序和中序遍历构建二叉树 | Medium
要求:通过二叉树的前序和中序遍历序列构建一颗二叉树 代码如下: struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode ...
- js深拷贝与浅拷贝
1 基础知识:基本类型与引用类型 JS中可以把变量分成两部分,基本类型和引用类型. 基本类型包括:Undefined.Null.Boolean.Number和String: 引用类型值可能由多个值构成 ...
- undefined 和 undeclared 的区别
var a; //undefined b; // b is not defined 区别:在变量作用域中已经申明但没有赋值的变量(如 a),是undefined.相反,在变量作用域中没有申明过的变量, ...
- Xamarin.Android Timer使用方法
首先声明命名空间: using System.Threading; 然后创建Timer对象: Timer timer; 接着实例化timer并且给委托事件: TimerCallback timerDe ...
- underscore.js源码解析【数组】
// Array Functions // --------------- // Get the first element of an array. Passing **n** will retur ...
- Python基础之带你快速掌握列表的常用方法
append 前面说过列表是一种 内容可改变的 对象. append方法就会改变列表的内容,在后面添加一个元素 比如 a = [1, 2, 3.14, 'hello'] # append 之后,a就变 ...
- salesforce lightning零基础学习(五) 事件阶段(component events phase)
上一篇介绍了lightning component events的简单介绍.此篇针对上一篇进行深入,主要讲的内容为component event中的阶段(Phase). 一. 阶段(Phase)的概念 ...
- tomcat8 JVM 优化
在Linux环境下设置Tomcat JVM,在/opt/tomcat/bin/catalina.sh文件中找到"# ----- Execute The Requested Command&q ...