ros_python3_issues icon indicating copy to clipboard operation
ros_python3_issues copied to clipboard

rosrun doesn't work

Open QAbot-zh opened this issue 5 years ago • 1 comments

I followed the tutorial steps of the medium blog, but an error occurred when I try to rosrun:

[rosrun] Couldn't find executable named issue_cv_bridge.py below /home/zxy/py3_ws/install/share/ros_python3_issues

I try to put the issue_cv_bridge.py file to the folder /home/zxy/py3_ws/install/share/ros_python3_issues, then I get the error like that:

Traceback (most recent call last):
  File "/home/zxy/py3_ws/install/share/ros_python3_issues/issue_cv_bridge.py", line 21, in <module>
    bridge = cv_bridge.CvBridge()
  File "/home/zxy/py3_ws/install/lib/python3/dist-packages/cv_bridge/core.py", line 67, in __init__
    import cv2
ImportError: dynamic module does not define module export function (PyInit_cv2)
libgcc_s.so.1 must be installed for pthread_cancel to work
[1]    17936 abort (core dumped)  rosrun ros_python3_issues issue_cv_bridge.py

QAbot-zh avatar Jul 10 '20 07:07 QAbot-zh

When I try to import cv_bridge in python3, it works.

➜  py3_ws python3
Python 3.5.2 (default, Apr 16 2020, 17:47:17) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rospy
>>> import cv_bridge
>>> import PIL.Image
>>> import numpy
>>> from sensor_msgs.msg import Image
>>> rospy.init_node('issue_cv_bridge_node')
>>> libgcc_s.so.1 must be installed for pthread_cancel to work
[1]    30229 abort (core dumped)  python3

what should I do to use python3 with ros...

QAbot-zh avatar Jul 10 '20 08:07 QAbot-zh