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

Importerror : cannot import name

asked 2014-05-20 19:17:37 -0500

Mehdi. gravatar image

Hello, I have been working on a node using a normal python IDE (spyder). Everything works fine, I can import all the needed python modules, some installed in /usr/local/lib and other in /usr/lib . When I run my code with rosrun,

    from withings import WithingsAuth, WithingsApi
ImportError: cannot import name WithingsAuth

withings is a module that was installed under Does somebody know how to fix this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-05-20 19:28:21 -0500

Mehdi. gravatar image

Apparently, when a ROS package has the same name as a python module, there is a conflict. Changing my packages's name to withings_pkg solved the problem.

edit flag offensive delete link more

Comments

I put my python script in the src folder. While generating srv headers, the python srv are automatically put on the withings/src/withings folder so if I try doing "from withing import" it will look on the local folder instead of the global libraries folder of python.

Mehdi. gravatar image Mehdi.  ( 2014-05-20 19:49:38 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2014-05-20 19:17:37 -0500

Seen: 5,683 times

Last updated: May 20 '14