PonomarevDA / tools

Cyphal, DroneCAN and stm32 related tools
MIT License
3 stars 6 forks source link

Ubuntu20.04 Run specification_checker.py to report error #10

Closed pioneerAlone closed 7 months ago

pioneerAlone commented 7 months ago

q@q-OptiPlex-5050:~/Bakewell/custom_prj/tools$ source cyphal/init.sh -i slcan0 - n 127 -v init.sh config:

q@q-OptiPlex-5050:~/Bakewell/custom_prj/tools$ pytest cyphal/specification_check er.py --verbose ============================= test session starts ============================== platform linux -- Python 3.8.10, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /home/q/Bakewell/custom_prj/tools plugins: asyncio-0.23.2 asyncio: mode=strict collected 0 items / 1 error

==================================== ERRORS ==================================== _____ ERROR collecting cyphal/specification_checker.py ___ ImportError while importing test module '/home/q/Bakewell/custom_prj/tools/cypha l/specification_checker.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.8/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) cyphal/specification_checker.py:13: in import pycyphal.application /home/q/.local/lib/python3.8/site-packages/pycyphal/application/init__.py:275: in from ._node import Node as Node, NodeInfo as NodeInfo, PortNotConfiguredErro r as PortNotConfiguredError /home/q/.local/lib/python3.8/site-packages/pycyphal/application/_node.py:10: in import uavcan.node E ModuleNotFoundError: No module named 'uavcan' =========================== short test summary info ============================ ERROR cyphal/specification_checker.py !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.26s ===============================

PonomarevDA commented 7 months ago

export YAKUT_PATH=/home/q/.cyphal

This notification means that your environment variable was set before running the script.

DSDL are already compiled in /home/q/.cyphal

This notification means that your output folder already exists and it is not empty (though it doesn't means that is has something useful), so the script skipped the compilation step.

import uavcan.node E ModuleNotFoundError: No module named 'uavcan'

Usually this error occurs when your DSDL are not compiled or the path is wrong.

I would recommend checking the content of .cyphal folder.

If you run the script using the default environment variables, it generates files with the following structure into tools/build/nunavut_out folder:

$ ls build/nunavut_out/
ds015  reg  uavcan

Just try to open a new shell and run the script again.

From my side I will consider adding more checks to capture your case and show a useful warning. Probably I should also consider to change the default YAKUT_PATH value to ~/.cyphal because it is more consistent with Cyphal tutorials.

pioneerAlone commented 7 months ago

Thanks, it works fine now.