AttributeError: 'module' object has no attribute 'RAW_OPT'
Asked Answered
S

1

6
Traceback (most recent call last):
  File "/opt/ros/melodic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 50, in <module>
    sys.argv, msg_template_map, srv_template_map)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 213, in generate_from_command_line_options
    generate_from_file(argv[1], options.package, options.outdir, options.emdir, options.includepath, msg_template_dict, srv_template_dict)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 154, in generate_from_file
    _generate_msg_from_file(input_file, output_dir, template_dir, search_path, package_name, msg_template_dict)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 99, in _generate_msg_from_file
    search_path)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 77, in _generate_from_spec
    interpreter = em.Interpreter(output=ofile, globals=g, options={em.RAW_OPT:True,em.BUFFERED_OPT:True})
AttributeError: 'module' object has no attribute 'RAW_OPT'
Traceback (most recent call last):
  File "/opt/ros/melodic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 50, in <module>
    sys.argv, msg_template_map, srv_template_map)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 213, in generate_from_command_line_options
    generate_from_file(argv[1], options.package, options.outdir, options.emdir, options.includepath, msg_template_dict, srv_template_dict)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 154, in generate_from_file
    _generate_msg_from_file(input_file, output_dir, template_dir, search_path, package_name, msg_template_dict)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 99, in _generate_msg_from_file
    search_path)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 77, in _generate_from_spec
    interpreter = em.Interpreter(output=ofile, globals=g, options={em.RAW_OPT:True,em.BUFFERED_OPT:True})
AttributeError: 'module' object has no attribute 'RAW_OPT'
Generating reconfiguration files for PathIntegralParams in autorally_control
Wrote header file in /home/autorally/catkin_ws/devel/include/autorally_control/PathIntegralParamsConfig.h
autorally/autorally_msgs/CMakeFiles/autorally_msgs_generate_messages_cpp.dir/build.make:106: recipe for target '/home/autorally/catkin_ws/devel/include/autorally_msgs/neuralNetLayer.h' failed
make[2]: *** [/home/autorally/catkin_ws/devel/include/autorally_msgs/neuralNetLayer.h] Error 1
make[2]: *** Deleting file '/home/autorally/catkin_ws/devel/include/autorally_msgs/neuralNetLayer.h'
autorally/autorally_msgs/CMakeFiles/autorally_msgs_generate_messages_cpp.dir/build.make:100: recipe for target '/home/autorally/catkin_ws/devel/include/autorally_msgs/line2D.h' failed
make[2]: *** [/home/autorally/catkin_ws/devel/include/autorally_msgs/line2D.h] Error 1
make[2]: *** Deleting file '/home/autorally/catkin_ws/devel/include/autorally_msgs/line2D.h'
CMakeFiles/Makefile2:3016: recipe for target 'autorally/autorally_msgs/CMakeFiles/autorally_msgs_generate_messages_cpp.dir/all' failed
make[1]: *** [autorally/autorally_msgs/CMakeFiles/autorally_msgs_generate_messages_cpp.dir/all] Error 2

I get this error when I catkin_make.

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
autorally_gazebo: Cannot locate rosdep definition for [effort_controllers]

I also get this error when I rosdep install.

Sensitize answered 11/12, 2023 at 20:6 Comment(4)
Are you installing a package directly, or building from source? You can also try rosdep update --include-eol-distros since EOL distros don't always play nice with rosdepLatchkey
I am building for the sourceSensitize
I am using conda Python 2.7 environmentSensitize
I am still getting the "AttributeError: 'module' object has no attribute 'RAW_OPT'" errorSensitize
I
16

To fix this issue I started by following an old solution of uninstalling em and installing empy. This alone wasn't enough though, because the latest version of empy (4.0) from November 30 seems to be causing this new issue of AttributeError: 'module' object has no attribute 'RAW_OPT', so instead I installed an older version of empy as follows:

pip uninstall em
pip install empy==3.3.4
Incompetence answered 13/12, 2023 at 21:30 Comment(1)
This was the case while making PX4-SITL from source (error caused by PX4-Autopilot/Tools/msg/px_generate_uorb_topic_files.py, line 261). Comment for the crawlers.Suzy

© 2022 - 2024 — McMap. All rights reserved.