Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'Robot' from 'controller' #6545

Open
A01752228 opened this issue May 3, 2024 · 1 comment
Open

ImportError: cannot import name 'Robot' from 'controller' #6545

A01752228 opened this issue May 3, 2024 · 1 comment

Comments

@A01752228
Copy link

Describe the Bug
I have a problem when I want to run the executable .py on the launch. I'm currently working on ROS and when I try to run the launch it says that the library Robot cannot be imported

Traceback (most recent call last):
File "/home/user/catkin_ws/src/webots_ros/controllers/drive_1/drive_1.py", line 4, in
from controller import Robot
ImportError: cannot import name 'Robot' from 'controller' (/home/user/.local/lib/python3.8/site-packages/controller/init.py)
[webots_ros_python-3] process has died [pid 9285, exit code 1, cmd /home/user/catkin_ws/src/webots_ros/controllers/drive_1/drive_1.py __name:=webots_ros_python __log:=/home/user/.ros/log/00039720-08e7-11ef-9ebc-8dc438824077/webots_ros_python-3.log].
log file: /home/user/.ros/log/00039720-08e7-11ef-9ebc-8dc438824077/webots_ros_python-3*.log

@lukicdarkoo
Copy link
Member

It looks like it loads the wrong controller library (/home/user/.local/lib/python3.8/site-packages/controller/init.py). There are two possible causes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants