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

Unable to use opencv with ROS

asked 2019-11-19 14:15:56 -0600

khansaadbinhasan gravatar image

I am trying to follow along this tutorial:

I am getting this error while running the above program:

from cv_bridge.boost.cv_bridge_boost import getCvType ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost)

I am using multiple versions of python, the one getting used seems to be: /opt/ros/melodic/lib/python2.7/ since it is in the traceback: /opt/ros/melodic/lib/python2.7/dist-packages/cv_bridge/

echo $PYTHONPATH gives /home/kringata/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/melodic/lib/python2.7/dist-packages

I am using ROS Melodic on Ubuntu18.04

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-19 20:54:47 -0600

khansaadbinhasan gravatar image

This seems to be a python problem., I was able to use cv_bridge to convert cv2 image to ROS message but wasn't able to do the opposite which doesn't make much sense as a problem of which python I was using. The python being used seems to be the one provided by anaconda(it wasn't mentioned nowhere in traceback), so I changed the python being used and opted for system python with /usr/bin/python and it resolved the issue.

edit flag offensive delete link more

Question Tools



Asked: 2019-11-19 14:15:56 -0600

Seen: 785 times

Last updated: Nov 19 '19