linux安装python修改默认python版本方法
作者:laozhang 时间:2021-07-19 00:06:41
linux默认是安装了python,默认是安装python2.6.6,可能安装的版本是不能符合我们需要的python要求的。我们需要重新安装python的版本,今天演示一下安装python3
首先下载一个 wget 文件的地址 执行命令进行下载
下载完成以后进行解压,解压完成以后进行安装,执行tar -zxvf Python-3.6.1.tgz解压
cd Python-3.6.1 进入目录 ./configure --prefix=/usr/local/python3 配置python安装的位置
配置完成以后,执行make 编译 ,编译完成后执行 make install 进行安装,整个过程大约5-10分钟,安装成功之后,安装目录就在/usr/python
系统中原来的python在/usr/bin/python,通过ls -l可以看到,python是一个软链接,链接到本目录下的python2.6,我们可以删除python 2.6.6
mv /usr/bin/python /usr/bin/python.bak 执行命令,执行ln -s /usr/python/bin/python3 /usr/bin/python
执行完成以后,在运行一下python,看看python版本是否是3.6.1
标签:linux,python版本
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Django-xadmin+rule对象级权限的实现方式
2023-02-20 17:08:08
![](https://img.aspxhome.com/file/2023/3/77033_0s.jpg)
浅析Django 接收所有文件,前端展示文件(包括视频,文件,图片)ajax请求
2023-03-30 14:35:25
关于Pytorch的MLP模块实现方式
2021-12-19 03:28:22
![](https://img.aspxhome.com/file/2023/2/109912_0s.jpg)
python 从远程服务器下载日志文件的程序
2021-03-06 01:39:15
python使用itchat实现手机控制电脑
2023-08-30 20:20:14
![](https://img.aspxhome.com/file/2023/7/69557_0s.jpg)
一文带你了解Python中的字符串是什么
2021-10-16 06:05:27
![](https://img.aspxhome.com/file/2023/7/88987_0s.png)
基于python实现图片转字符画代码实例
2023-05-17 01:53:37
![](https://img.aspxhome.com/file/2023/0/66290_0s.png)
matplotlib图形整合之多个子图绘制的实例代码
2023-10-23 23:17:47
![](https://img.aspxhome.com/file/2023/9/110229_0s.png)
python 利用百度API进行淘宝评论关键词提取
2021-11-14 19:32:36
![](https://img.aspxhome.com/file/2023/5/67835_0s.png)
Python中用max()方法求最大值的介绍
2021-12-08 09:33:06
关于Python 解决Python3.9 pandas.read_excel(‘xxx.xlsx‘)报错的问题
2021-11-05 01:05:28
![](https://img.aspxhome.com/file/2023/6/80766_0s.png)
神经网络算法RNN实现时间序列预测
2021-10-14 00:21:31
详解python字节码
2021-12-16 16:56:29
Python实现按当前日期(年、月、日)创建多级目录的方法
2022-05-01 09:22:01
![](https://img.aspxhome.com/file/2023/7/95667_0s.png)
python爬取微信公众号文章图片并转为PDF
2021-02-02 06:53:31
![](https://img.aspxhome.com/file/2023/5/82735_0s.jpg)
解析ROC曲线绘制(python+sklearn+多分类)
2021-04-06 12:16:16
![](https://img.aspxhome.com/file/2023/4/78564_0s.png)
Oracle与SQL Server数据库镜像对比
2009-03-25 14:27:00
ORACLE 最大连接数的问题
2009-07-23 14:27:00
Python中二维列表如何获取子区域元素的组成
2021-02-16 02:41:01
![](https://img.aspxhome.com/file/2023/8/95488_0s.png)
python代码实现猜拳小游戏
2023-10-16 19:00:46
![](https://img.aspxhome.com/file/2023/3/63593_0s.jpg)