ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ModuleNotFoundError: No module named 'error'

asked 2022-01-22 16:16:12 -0600

Evgeny gravatar image

updated 2022-02-22 11:17:05 -0600

lucasw gravatar image

hi everyone, please help me regarding this error:

[ 68%] Built target carla_ackermann_control_generate_messages_lisp
[ 71%] Built target carla_ackermann_control_generate_messages_nodejs
[ 72%] Built target cv_bridge
[ 75%] Built target image_geometry
Traceback (most recent call last):
  File "/opt/ros/melodic/share/genpy/cmake/../../../lib/genpy/genmsg_py.py", line 43, in <module>
    import genpy.generator
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/__init__.py", line 34, in <module>
    from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/message.py", line 48, in <module>
    import yaml
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 2, in <module>
    from error import *
ModuleNotFoundError: No module named 'error'
ros-bridge/carla_ackermann_control/CMakeFiles/carla_ackermann_control_generate_messages_py.dir/build.make:77: recipe for target '/home/caramel/carla-ros-bridge/catkin_ws/devel/lib/python3/dist-packages/carla_ackermann_control/msg/_EgoVehicleControlInfo.py' failed
make[2]: *** [/home/caramel/carla-ros-bridge/catkin_ws/devel/lib/python3/dist-packages/carla_ackermann_control/msg/_EgoVehicleControlInfo.py] Error 1
Traceback (most recent call last):
  File "/opt/ros/melodic/share/genpy/cmake/../../../lib/genpy/genmsg_py.py", line 43, in <module>
    import genpy.generator
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/__init__.py", line 34, in <module>
    from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/message.py", line 48, in <module>
    import yaml
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 2, in <module>
    from error import *
ModuleNotFoundError: No module named 'error'
Traceback (most recent call last):
  File "/opt/ros/melodic/share/genpy/cmake/../../../lib/genpy/genmsg_py.py", line 43, in <module>
    import genpy.generator
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/__init__.py", line 34, in <module>
    from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/message.py", line 48, in <module>
    import yaml
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 2, in <module>
    from error import *
ModuleNotFoundError: No module named 'error'
ros-bridge/carla_ackermann_control/CMakeFiles/carla_ackermann_control_generate_messages_py.dir/build.make:92: recipe for target '/home/caramel/carla-ros-bridge/catkin_ws/devel/lib/python3/dist-packages/carla_ackermann_control/msg/_EgoVehicleControlTarget.py' failed
make[2]: *** [/home/caramel/carla-ros-bridge/catkin_ws/devel/lib/python3/dist-packages/carla_ackermann_control/msg/_EgoVehicleControlTarget.py] Error 1
Traceback (most recent call last):
  File "/opt/ros/melodic/share/genpy/cmake/../../../lib/genpy/genmsg_py.py", line 43, in <module>
    import genpy.generator
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/__init__.py", line 34, in <module>
    from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
  File "/opt/ros/melodic/lib/python2.7/dist-packages/genpy/message.py", line 48, in <module>
    import yaml
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 2, in <module>
    from error import *
ModuleNotFoundError: No module named 'error'
ros-bridge/carla_ackermann_control/CMakeFiles/carla_ackermann_control_generate_messages_py.dir/build.make:82: recipe for target '/home/caramel/carla-ros-bridge/catkin_ws/devel/lib/python3/dist-packages/carla_ackermann_control/msg/_EgoVehicleControlMaxima.py' failed
make[2]: *** [/home/caramel/carla-ros-bridge/catkin_ws/devel/lib/python3/dist-packages/carla_ackermann_control/msg/_EgoVehicleControlMaxima.py] Error 1
ros-bridge/carla_ackermann_control/CMakeFiles/carla_ackermann_control_generate_messages_py.dir/build.make:87: recipe for target '/home/caramel/carla-ros-bridge/catkin_ws/devel/lib/python3/dist-packages/carla_ackermann_control ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-01-24 04:11:24 -0600

osilva gravatar image

Please take a look at prior answer.: https://answers.ros.org/question/3149...

The error to fix is from yaml library

ModuleNotFoundError: No module named 'error'
edit flag offensive delete link more

Comments

hi I m unable to open my env file. any suggetion?

znz gravatar image znz  ( 2022-01-24 04:42:12 -0600 )edit
0

answered 2022-01-24 05:03:33 -0600

znz gravatar image

thank you so much the issue is resolved by unsetting the path and building the catkin workspace again with restart by the following command:

unset PYTHONPATH

thanks

edit flag offensive delete link more

Question Tools

Stats

Asked: 2022-01-22 07:22:03 -0600

Seen: 1,151 times

Last updated: Feb 22 '22