鸿蒙开发编译执行hpm dist遇到以下问题
Generating Third Party Open Source Notice...
Third Party Open Source Notice generated.
Building: bearpi_hm_nano
/usr/lib/scons/SCons/Defaults.py:213: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if len(operation_list) is not 2:
scons: *** No SConstruct file found.
File "/usr/lib/scons/SCons/Script/Main.py", line 924, in _main
Distribution error: Failed to find the distribution bundle from bearpi_hm_nano.
Check error details by "/home/bearpi/.hpm/log/debug/debug.2021-11-20-10-54-17.log"
先说结论
bearpi-hm_nano代码获取方式有两种方式,一个从git clone,
这种编译方式使用python build.py BearPi-HM_Nano
另一个是
hpm init -t default
hpm i @bearpi/bearpi_hm_nano
这种方式才是hpm dist编译
如果用后者编译前者的代码就会抛出以上错误哦。
----
不过这个过程也让我知道了Python 3.8 是不支持is not这种语句只能改为!=
另外要更新sconst,可以在/usr/lib/sconst
python -m pip install scons
进行更新