Ubuntu22 下载100ask_imx6ull_pro开发板内核出错

book@ubuntu22:~/100ask_imx6ull-sdk$ …/repo/repo init -u manifests: 百问网所有开发板的源码repo主仓库地址。 -b linux-sdk -m imx6ull/100ask_imx6ull_linux4.9.88_release.xml --no-repo-verify
Traceback (most recent call last):
File “/home/book/repo/main.py”, line 56, in
from subcmds.version import Version
File “/home/book/repo/subcmds/init.py”, line 35, in
mod = import(name,
File “/home/book/repo/subcmds/diffmanifests.py”, line 19, in
from manifest_xml import XmlManifest
File “/home/book/repo/manifest_xml.py”, line 37, in
from project import RemoteSpec, Project, MetaProject
File “/home/book/repo/project.py”, line 33, in
import requests
ModuleNotFoundError: No module named ‘requests’

1 Like

请哪位老师帮忙看一下怎么解决。

就是 ubuntu22.04 使用的是 python3.10;其丢弃了 repo 中的某些接口;

解决方法:

1. 添加 ppa 源,此源可安装多个 python 版本
sudo add-apt-repository ppa:deadsnakes/ppa

2. 安装 python3.9
sudo apt install python3.9

3. 建立 python 的组,并添加 Python3.9 的可选项,优先级为 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1

4. 验证当前 python 是否是 3.9 版本
python --version

5. 如果不是,用以下命令手动配置一下
sudo update-alternatives --config python

6. 初始化 .repo 仓库
../repo/repo init -u https://gitee.com/weidongshan/manifests.git -b linux-sdk -m imx6ull/100ask_imx6ull_linux4.9.88_release.xml --no-repo-verify

7. 同步出源码
../repo/repo sync -j4

参考博客1
参考博客2
参考链接3

1 Like

如果还有问题,把 python2 也装一下;
sudo apt install python2-dev python2

老师好!我执行sudo add-apt-repository ppa:deadsnakes/ppa 命令后安装不了 python3.9,也安装不了 python2。请老师指导再一下:

book@ubuntu22:/usr/bin$ sudo apt install python3.9
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package python3.9
E: Couldn’t find any package by glob ‘python3.9’
book@ubuntu22:/usr/bin$ python --version
Python 3.10.7
book@ubuntu22:/usr/bin$ sudo apt install python2-dev python2
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package python2-dev
E: Unable to locate package python2
book@ubuntu22:/usr/bin$

1. 更新一下再执行安装命令,如果还是同样的报错再执行第二步;
sudo apt-get update

2. 查看是否有 sources.list.bak 文件;
ls /etc/apt/sources.list.bak

3. 如果有就将 bak 文件覆盖 sources.list;
sudo rm /etc/apt/sources.list
sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list

4. 更新一下
sudo apt-get update

谢谢老师的指导。安装好python3.9后,就可以下载源码了。再次感谢老师指导!!!

感谢老哥 终于找到解决方案了啊啊啊啊啊啊啊啊啊啊

谢谢谢谢 终于啊啊啊啊啊啊啊啊啊啊啊啊