解决报错:No module named ‘yaml‘

报错来源于Odrive开源项目

解决报错:No module named ‘yaml‘_第1张图片
Odrive项目地址

报错原文

Pu'LiCe@DESKTOP-OIVHV6C MINGW64 /d/DWorkGrowup/Git/ODrive/Firmware (master)
$ make
board version: v3.5-24V
Firmware version 0.5.2-dev (fw-v0.5.2-21-g19e9b39b*)
* ~ 0% 102) python -B interface_generator_stub.py --definitions odrive-interface.yaml --template fibre-cpp/function_stubs_template.j2 --output autogen/function_stubs.hpp
No module named 'yaml'
Note that there are new compile-time dependencies since around v0.5.1.
Check out 
............................................................
...........................................................
..........................................................
https://github.com/madcowswe/ODrive/blob/devel/docs/developer-guide.md#prerequisites for details.
 *** tup messages ***
 *** Command ID=413 failed with return value 1
* ~ 3%  99) python -B interface_generator_stub.py --definitions odrive-interface.yaml --generate-endpoints ODrive3 --template fibre-cpp/endpoints_template.j2 --output autogen/endpoints.hpp
No module named 'yaml'
Note that there are new compile-time dependencies since around v0.5.1.
Check out https://github.com/madcowswe/ODrive/blob/devel/docs/developer-guide.md#prerequisites for details.
 *** tup messages ***
 *** Command ID=417 failed with return value 1
 *** tup: 4 jobs failed.
make: *** [Makefile:33: all] Error 1

报错原因及我的分析流程

注意出现这种错误时我的平台是Windows10,在出现错误之前我已经按照开发文档的要求安装了ARM开发工具链以及TUP等等,但是安装的所有工具基本都会比开发文档要求的版本高出许多,所实话看到报错我有点慌。
因为我安装的工具起码有四五个可能出错的地方太多了后来我又将源码迁移到我的linux虚拟机进行从新部署,安装一个工具我就make一下当我安装到python3的时候出现了与window10一样的报错信息,由此确定错误一定是这里出了问题。

解决问题

解决方法其实在开发文档中已经写清楚了,只是我安装python3的时候没看明白
解决报错:No module named ‘yaml‘_第2张图片

* Install Python packages: `pip install PyYAML Jinja2 jsonschema`

所以我们只需要在命令行运行这个 pip install PyYAML Jinja2 jsonschema就可以了,好吧!一开始我以为真就能这么简单的解决问题
但是等我运行完这个命令后,将这个新下载的包的路径加到环境变量再去make结果出现的问题还是老样子

笨办法

给我惹急了我看了一下新安装的包地址将里面的各种工具直接复制粘贴到我的python3的安装地址解决报错:No module named ‘yaml‘_第3张图片

再去make成功解决问题

Pu'LiCe@DESKTOP-OIVHV6C MINGW64 /d/DWorkGrowup/Git/ODrive/Firmware (master)
$ make -j24
board version: v3.5-24V
Firmware version 0.5.2-dev (fw-v0.5.2-21-g19e9b39b*)
tup warning: generated file 'build\obj\fibre-cpp_legacy_protocolcpp.o' was deleted outside of tup. This file may be re-created on the next update.
..........................................
.........................................
.........................................
tup warning: generated file 'build\ODriveFirmware.bin' was deleted outside of tup. This file may be re-created on the next update.
  99%  1) [0.015s] arm-none-eabi-size build/ODriveFirmware.elf
   text    data     bss     dec     hex filename
 336920    3864  141976  482760   75dc8 build/ODriveFirmware.elf

你可能感兴趣的:(开发问题收集器哈!,c++,python,c语言)