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

Use pycharm in ros

asked 2019-02-04 13:08:33 -0600

Pujie gravatar image

I hope to use pycharm in ros and I suffered this problem:

Traceback (most recent call last):
  File "/home/pujie/catkin_ws/src/newdetector/script/", line 3, in <module>
    import rospy
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/", line 47, in <module>
    from std_msgs.msg import Header
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/std_msgs/msg/", line 1, in <module>
    from ._Bool import *
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/std_msgs/msg/", line 5, in <module>
    import genpy
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/", line 34, in <module>
    from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/", line 44, in <module>
    import yaml
ImportError: No module named yaml

I can run the code by rosrun +package and I noticed there are relative questions [here:].

I think my python path is wrongimage description but i can't set the path in /opt/ros/$ros_release/lib/python2.7/dist-packages, image description

How can I config this problem?

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-04 14:14:45 -0600

Pujie gravatar image

I solved it! With adding package and search for rospkg rather than rospy image description

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-02-04 13:08:33 -0600

Seen: 1,547 times

Last updated: Feb 04 '19