参考友晶科技提供的https://github.com/johnnyfan1979/public_doc/blob/main/documentation/DE25_Nano/DE25%20Nano%20Build%20Linux%20image%20from%20scratch.md

当构建 U-Boot 时 提示缺少Python模块'setuptools':

Traceback (most recent call last):
File "/home/doreen/DE25_Nano_A5_sdmmc/u-boot-socfpga/scripts/dtc/pylibfdt/setup.py", line 23, in <module>
from setuptools import setup, Extension
ModuleNotFoundError: No module named 'setuptools'
HOSTCC scripts/dtc/srcpos.o
make[2]: *** [scripts/dtc/pylibfdt/Makefile:33: rebuild] Error 1
make[1]: *** [scripts/Makefile.build:398: scripts/dtc/pylibfdt] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:2081: scripts_dtc] Error 2
make: *** Waiting for unfinished jobs....

这个错误发生在构建U-Boot时,在编译设备树编译器(dtc)的Python绑定(pylibfdt)时,因为缺少setuptools而失败。

Screenshot from 2025-12-05 00-41-38

 

安装Python的setuptools模块。

sudo apt install python3-setuptools

 

Screenshot from 2025-12-05 00-41-20

 接下来就可以继续执行:

make -j $(nproc)