ubuntu16.04 Install Python 3.6.2

问题描述: 更新同步rk3588 Linux版本代码时候,出现以下报错:

  repo: warning: Python 2 is no longer supported; Please upgrade to Python 3.6+.

目前的Ubuntu版本安装的python是2.7版本的,需要更新

1.下载新版python:
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz

2.下载完成之后,进行解压缩:# tar -zxvf Python-3.6.2.tgz

3.进入解压缩后的目录,安装配置:

# cd Python-3.6.2/

# ./configure

4.编译 & 安装:
make
sudo make install

5.安装成功以后,就可以查看 Python2 的版本:
# python3 -V
Python 3.6.2

6.修改默认Python版本,建立软链接:
将原来 python 的软链接重命名:# mv /usr/bin/python /usr/bin/python.bak
将 python 链接至 python3:# ln -s /usr/local/bin/python3 /usr/bin/python

这时,再查看 Python 的版本:
# python -V
Python 3.6.2

 

此时,再执行.repo/repo/repo sync -c同步代码的时候,就没有报错了。

 

参考:https://blog.csdn.net/weixin_45043480/article/details/125941253

  https://www.jianshu.com/p/940b774a0a23

posted @ 2023-02-23 14:19  M-kobe  阅读(29)  评论(0)    收藏  举报