You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu24.04下VSCode+PlatformIO开发microbit遇distutils缺失错误

解决Ubuntu 24.04下PlatformIO+Zephyr运行micro:bit Blink示例的distutils缺失问题

在全新Ubuntu 24.04系统中,使用VSCode搭配PlatformIO和Zephyr框架运行BBC micro:bit控制器的Blink示例时出现报错,经排查是Python 3.12环境缺少必需的distutils组件,具体报错输出如下:

...
PACKAGES: 
 - framework-zephyr @ 2.20701.220422 (2.7.1) 
 - tool-cmake @ 3.21.3 
 - tool-dtc @ 1.4.7 
 - tool-gperf @ 3.0.4 
 - tool-ninja @ 1.7.1 
 - tool-sreccat @ 1.164.0 (1.64) 
 - toolchain-gccarmnoneeabi @ 1.80201.181220 (8.2.1)
Reading CMake configuration...
Parsing system calls...
Generating syscall files
Generating KObject files...
Traceback (most recent call last):
  File "/home/markus/.platformio/packages/framework-zephyr/scripts/gen_kobject_list.py", line 60, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'
*** Error 1
Validating driver...
Traceback (most recent call last):
  File "/home/markus/.platformio/packages/framework-zephyr/scripts/gen_kobject_list.py", line 60, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'
*** Error 1
...

解决步骤

  • 打开终端,执行以下命令安装Python 3的distutils组件:
    sudo apt-get install python3-distutils
    
  • 安装完成后,回到VSCode重新运行PlatformIO的构建流程即可正常编译。

内容的提问来源于stack exchange,提问作者Max

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 17:27:39