Ask Your Question
1

ImportError: cannot import name CvBridge

asked 2015-04-07 14:02:38 -0500

HITE gravatar image

updated 2016-11-29 22:43:02 -0500

130s gravatar image

Hello,

I am trying to use the cv_bridge package to convert an Image topic to opencv format on Indigo. I am using the code from the cv_bridge tutorial, and I added cv_bridge to my package manifest as a build_depend, buildtool_depend, and a run_depend. When I attempt to run the bridge, I am getting the following error:

Traceback (most recent call last):
      File "cv_bridge.py", line 9, in <module>
    from cv_bridge import CvBridge, CvBridgeError
      File    "/home/kghite/catkin_ws/src/comprobo2014/src/neato_robot/neato_2dnav/scripts/cv_bridge.py", line 9, in        <module>
    from cv_bridge import CvBridge, CvBridgeError
ImportError: cannot import name CvBridge

I would really appreciate any help you can give. Thanks!

edit retag flag offensive close merge delete

Comments

Hi, I'm having the same issue. Did you solve this by any chance?

voladoddi gravatar imagevoladoddi ( 2015-04-22 15:51:59 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-06-10 12:50:28 -0500

HITE gravatar image

Solved quite a while back, but hadn't seen the comment above, so:

It actually ended up being that I had named the python script I was writing cv_bridge.py as well, which was messing with the import statement (basically it was trying to import from itself). I changed the name and everything worked fine!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-04-07 14:02:38 -0500

Seen: 1,100 times

Last updated: Nov 29 '16