I try to build nav2_ws from tutorial on nav2 build and install, and I get this error

--- stderr: nav_2d_msgs                                              
Error processing idl file: /home/uchi/nav2_ws/build/nav_2d_msgs/rosidl_adapter/nav_2d_msgs/msg/Path2D.idl
Traceback (most recent call last):
  File "/home/uchi/ros2_humble/install/rosidl_generator_py/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py", line 40, in <module>
  File "/home/uchi/ros2_humble/install/rosidl_generator_py/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py", line 36, in main
    generate_py(args.generator_arguments_file, args.typesupport_impls.split(';'))
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/generate_py_impl.py", line 61, in generate_py
    generated_files = generate_files(generator_arguments_file, mapping)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_cmake/__init__.py", line 96, in generate_files
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_cmake/__init__.py", line 87, in generate_files
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_cmake/__init__.py", line 128, in expand_template
    interpreter = em.Interpreter(
AttributeError: module 'em' has no attribute 'Interpreter'
gmake[2]: *** [nav_2d_msgs__py/CMakeFiles/nav_2d_msgs__py.dir/build.make:167: rosidl_generator_py/nav_2d_msgs/_nav_2d_msgs_s.ep.rosidl_typesupport_fastrtps_c.c] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:590: nav_2d_msgs__py/CMakeFiles/nav_2d_msgs__py.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Failed   <<< nav_2d_msgs [2.83s, exited with code 2]
Aborted  <<< nav2_msgs [2.24s] 

It failed on building nav_2d_msgs. Does anyone know how to fix this?

SOLVED: To fix this, I uninstall em, which might cause the conflict, and install pip install empy & lark. But it lead to another error AttributeError: module 'em' has no attribute "'BUFFERED_OPT'". The problem is new empy version doesn't have BUFFTERD_OPT or RAW_OPT anymore, from what I understand. I need to install old version of pip install empy==3.3.4. Solution found here


1 Answer 1


Probably you don't have the EM module installed, that is why the "Interpreter" attribute is not being found.

Try to install it and check if it fix

pip3 install empy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.