AttributeError: 'module' object has no attribute 'RAW_OPT'

4.1k views Asked by At
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.

1

There are 1 answers

1
Diogo Correia On

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