nasa-jpl / osr-rover-code

Code that runs on the Open Source Rover
Apache License 2.0
435 stars 148 forks source link

ModuleNotFoundError: No module named 'roboclaw' #156

Closed JHPHELAN closed 2 years ago

JHPHELAN commented 2 years ago

Following https://github.com/nasa-jpl/osr-rover-code/blob/foxy-devel/setup/rpi.md in section: 6 Testing serial comm with the Roboclaw motors controllers Run the roboclawtest.py script with all of the motor addresses:

ubuntu@AUDACITY:~$ cd ~/osr_ws/src/osr-rover-code/scripts
-bash: cd: /home/ubuntu/osr_ws/src/osr-rover-code/scripts: No such file or directory
ubuntu@AUDACITY:~$ sudo find / -name roboclawtest.py
/home/ubuntu/osr_ws/osr-rover-code/scripts/roboclawtest.py
ubuntu@AUDACITY:~$ cd osr_ws/osr-rover-code/scripts/
ubuntu@AUDACITY:~/osr_ws/osr-rover-code/scripts$ python roboclawtest.py 128
Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python
ubuntu@AUDACITY:~/osr_ws/osr-rover-code/scripts$ python3 roboclawtest.py 128
Traceback (most recent call last):
  File "roboclawtest.py", line 13, in <module>
    from roboclaw import Roboclaw
ModuleNotFoundError: No module named 'roboclaw'
Achllle commented 2 years ago

As mentioned on Slack,

-bash: cd: /home/ubuntu/osr_ws/src/osr-rover-code/scripts: No such file or directory

means you made a mistake and you cloned the repository to the wrong folder.

This is also why the above issue with ModuleNotFoundError happens. We add that directory to the python path directly, and in your case it can't find it because it's wrong.