属性错误:“模块”对象没有属性“RAW_OPT”

问题描述 投票:0回答:1
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

当我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]

我在 rosdep 安装时也遇到此错误。

ros catkin
1个回答
0
投票

我设法通过遵循卸载 em 并安装 empy旧解决方案解决了这个问题。但这还不够,因为 11 月 30 日的最新版本 empy (4.0) 似乎导致了这个新问题,所以我安装了一个旧版本,如下所示:

pip uninstall em
pip install empy==3.3.4
© www.soinside.com 2019 - 2024. All rights reserved.