Aosp代码repo时候需要python3.7,Ubuntu16.04下升级Python到3.7
Posted Android高级知识分享官
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Aosp代码repo时候需要python3.7,Ubuntu16.04下升级Python到3.7相关的知识,希望对你有一定的参考价值。
第一步,增加ppa仓库:
sudo add-apt-repository ppa:jonathonf/python-3.7
第二步更新库
sudo apt-get update
第三步安装库
sudo apt-get install python3.7
安装好了后需要对系统默认python切换:
lrwxrwxrwx 1 root root 26 8月 16 2019 dh_pypy -> ../share/dh-python/dh_pypy
-rwxr-xr-x 1 root root 1056 11月 24 2017 dh_python2
lrwxrwxrwx 1 root root 29 8月 16 2019 dh_python3 -> ../share/dh-python/dh_python3
lrwxrwxrwx 1 root root 23 3月 2 2021 pdb2.7 -> ../lib/python2.7/pdb.py
lrwxrwxrwx 1 root root 23 1月 27 2021 pdb3.5 -> ../lib/python3.5/pdb.py
lrwxrwxrwx 1 root root 23 2月 21 2021 pdb3.7 -> ../lib/python3.7/pdb.py
lrwxrwxrwx 1 root root 31 8月 11 2020 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root root 26 8月 16 2019 pybuild -> ../share/dh-python/pybuild
lrwxrwxrwx 1 root root 9 8月 11 2020 python -> python2.7
lrwxrwxrwx 1 root root 9 8月 11 2020 python2 -> python2.7
-rwxr-xr-x 1 root root 3492624 3月 2 2021 python2.7
lrwxrwxrwx 1 root root 9 8月 11 2020 python3 -> python3.5
-rwxr-xr-x 2 root root 4456208 1月 27 2021 python3.5
-rwxr-xr-x 2 root root 4456208 1月 27 2021 python3.5m
-rwxr-xr-x 2 root root 5078728 2月 21 2021 python3.7
-rwxr-xr-x 2 root root 5078728 2月 21 2021 python3.7m
lrwxrwxrwx 1 root root 10 8月 11 2020 python3m -> python3.5m
lrwxrwxrwx 1 root root 29 8月 11 2020 pyversions -> ../share/python/pyversions.py
删除python这个软引用:
sudo rm python
创建3.7的软引用
sudo ln -s python3.7 python
变成如下:
lrwxrwxrwx 1 root root 26 8月 16 2019 dh_pypy -> ../share/dh-python/dh_pypy
-rwxr-xr-x 1 root root 1056 11月 24 2017 dh_python2
lrwxrwxrwx 1 root root 29 8月 16 2019 dh_python3 -> ../share/dh-python/dh_python3
lrwxrwxrwx 1 root root 23 3月 2 2021 pdb2.7 -> ../lib/python2.7/pdb.py
lrwxrwxrwx 1 root root 23 1月 27 2021 pdb3.5 -> ../lib/python3.5/pdb.py
lrwxrwxrwx 1 root root 23 2月 21 2021 pdb3.7 -> ../lib/python3.7/pdb.py
lrwxrwxrwx 1 root root 31 8月 11 2020 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root root 26 8月 16 2019 pybuild -> ../share/dh-python/pybuild
lrwxrwxrwx 1 root root 9 11月 4 23:49 python -> python3.7
lrwxrwxrwx 1 root root 9 8月 11 2020 python2 -> python2.7
-rwxr-xr-x 1 root root 3492624 3月 2 2021 python2.7
lrwxrwxrwx 1 root root 9 8月 11 2020 python3 -> python3.5
-rwxr-xr-x 2 root root 4456208 1月 27 2021 python3.5
-rwxr-xr-x 2 root root 4456208 1月 27 2021 python3.5m
-rwxr-xr-x 2 root root 5078728 2月 21 2021 python3.7
-rwxr-xr-x 2 root root 5078728 2月 21 2021 python3.7m
lrwxrwxrwx 1 root root 10 8月 11 2020 python3m -> python3.5m
lrwxrwxrwx 1 root root 29 8月 11 2020 pyversions -> ../share/python/pyversions.py
以上是关于Aosp代码repo时候需要python3.7,Ubuntu16.04下升级Python到3.7的主要内容,如果未能解决你的问题,请参考以下文章
Repo下载AOSP源码:基于ubuntu22.04 环境配置
Repo下载编译AOSP源码:基于Ubuntu 21.04,android-12.1.0_r27