惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
雷峰网
雷峰网
博客园 - 叶小钗
C
Check Point Blog
F
Fortinet All Blogs
A
About on SuperTechFans
Y
Y Combinator Blog
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
云风的 BLOG
云风的 BLOG
U
Unit 42
博客园_首页
量子位
M
MIT News - Artificial intelligence
G
Google Developers Blog
小众软件
小众软件
N
Netflix TechBlog - Medium
P
Palo Alto Networks Blog
S
Schneier on Security
T
Tor Project blog
F
Full Disclosure
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tenable Blog
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
Security Latest
Security Latest
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - 司徒正美
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
Recorded Future
Recorded Future
L
Lohrmann on Cybersecurity
I
Intezer
L
LangChain Blog
L
LINUX DO - 热门话题

博客园 - 一个人的合唱

手写简易docker synchronized 泛型学习 反码与补码 解决128位秘钥长度限制的方法 CAP学习 ThreadLocal的学习 读书笔记脑图列表 a=a++和a=++a 深入理解jvm虚拟机笔记(二) AtomicInteger的使用 volatile学习 echarts重新绘制的时候数据未更新 深入理解jvm虚拟机笔记(一) elasticsearch学习笔记 使用fiddler模拟post请求 二叉堆 二叉平衡树 二叉查找树
centos7下安装python3
一个人的合唱 · 2017-12-13 · via 博客园 - 一个人的合唱

查看是否已经安装Python

CentOS 7.2 默认安装了python2.7.5 因为一些命令要用它比如yum 它使用的是python2.7.5。

使用 python -V 命令查看一下是否安装Python

然后使用命令 which python 查看一下Python可执行文件的位置

可见执行文件在/usr/bin/ 目录下,切换到该目录下执行 ll python*命令查看

python 指向的是python2.7

安装python3

在centos上执行下面两行命令即可安装python3

sudo yum install epel-release
sudo yum install python34

安装好之后,python3在/usr/bin中

使得pthon2和python3并存

然后执行rm -rf python删除软链接,然后执行

sudo ln -s /usr/bin/python3  /usr/bin/python

添加新链接使其指向python3,这时便变成

因为/usr/bin/python这时指向python3所以需要修改yum的配置把#! /usr/bin/python修改为#! /usr/bin/python2

同理 vim /usr/libexec/urlgrabber-ext-down 文件里面的#! /usr/bin/python也要修改为#! /usr/bin/python2

这样python3版本就安装完成;同时python2也存在