在CentOS7下安装Python3教程解析
作者:盗哥泡茶去了 时间:2021-09-17 16:51:13
查看系统原有Python
注:可以将python指向python3,但必须修改一些命令如yum的配置,不然会报错。
安装依赖
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
下载python3.8.1(版本太多,我也不知道选哪个,看了官方文档,就先用stable/稳定版吧)
wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
解压缩并编译安装
[root@pmmy ~]# tar -xvf Python-3.8.1.tgz
[root@pmmy ~]# cd Python-3.8.1
[root@pmmy Python-3.8.1]# ./configure --prefix=/usr/local/python3 --enable-optimizations
注:--prefix=是指定编译安装的目录--enable-optimizations是对python的优化,能提升其性能。
[root@pmmy Python-3.8.1]# make && make install
添加命令路径
vim /etc/profile
在最后一行添加:
export PATH=$PATH:/usr/local/python3/bin
刷新配置文件
source /etc/profile
测试
来源:https://www.cnblogs.com/1016391912pm/p/13255991.html
标签:CentOS,安装,Python
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
列表模块是否需要标题
2009-06-25 14:11:00
![](https://img.aspxhome.com/file/UploadPic/20096/25/g2009620101624-60s.jpg)
SQL Server 日期相关资料详细介绍
2012-07-11 16:14:07
python操作微信自动发消息的实现(微信聊天机器人)
2021-01-06 23:22:24
交互设计实用指南系列(6) –标签明晰、有效
2010-01-21 12:39:00
![](https://img.aspxhome.com/file/UploadPic/20101/21/32-66s.jpg)
理解Python数据离散化手写if-elif语句与pandas中cut()方法实现
2023-02-24 10:33:33
Microsoft SQL Server 安全问题
2010-07-26 13:20:00
Anaconda修改默认虚拟环境安装位置的方案分享
2022-11-19 22:36:52
![](https://img.aspxhome.com/file/2023/9/103239_0s.png)
python爬取豆瓣评论制作词云代码
2023-03-14 04:31:40
![](https://img.aspxhome.com/file/2023/6/68286_0s.jpg)
浏览器调试动态js脚本的方法(图解)
2023-07-06 22:51:08
![](https://img.aspxhome.com/file/2023/4/55894_0s.jpg)
Python利用filestools模块实现水印添加
2021-09-11 06:36:08
![](https://img.aspxhome.com/file/2023/1/87581_0s.jpg)
Django框架静态文件使用/中间件/禁用ip功能实例详解
2023-06-12 02:48:38
![](https://img.aspxhome.com/file/2023/6/71346_0s.png)
在ASP.NET 2.0中操作数据之十:使用 GridView和DetailView实现的主/从报表
2023-07-02 20:22:40
![](https://img.aspxhome.com/file/2023/6/76336_0s.png)
python内置函数sorted()用法深入分析
2022-06-26 07:41:40
使用python 写一个静态服务(实战)
2023-09-29 15:57:25
![](https://img.aspxhome.com/file/2023/6/91946_0s.jpg)
如何处理json中不带双引号的key的问题
2023-02-07 00:25:22
![](https://img.aspxhome.com/file/2023/1/89301_0s.png)
python3实现微型的web服务器
2021-03-03 09:00:49
Python 实现PS滤镜中的径向模糊特效
2023-11-04 19:48:49
![](https://img.aspxhome.com/file/2023/6/80696_0s.png)
基于MTCNN/TensorFlow实现人脸检测
2021-07-05 23:51:19
![](https://img.aspxhome.com/file/2023/5/88985_0s.png)
Pandas进行数据编码的十种方式总结
2021-10-17 19:05:56
![](https://img.aspxhome.com/file/2023/3/127133_0s.png)
PyTorch中可视化工具的使用
2021-03-05 23:11:39
![](https://img.aspxhome.com/file/2023/0/87500_0s.jpg)