3

I just installed the Adafruit MotorKit library and I created a little bit of code like this:

from adafruit_motorkit import MotorKit
kit = MotorKit()

But when I start the program with sudo command : sudo python motortest.py I had this :

ImportError: No Module named adafruit_motorkit

I do not understand because I followed the installation procedure of the library with the command: sudo pip3 install adafruit-circuitpython-motorkit

I run my program from raspbian desktop on Raspberry Pi 3B+

ValentinDP
  • 323
  • 5
  • 14

1 Answers1

2

you install the module via pip3 so you need to run the script with python3 .

like this: sudo python3 motortest.py

ddor254
  • 1,570
  • 1
  • 12
  • 28
  • you shouldn't run python scripts as sudo - you'll get this error because the instruction say to install it with sudo pip3 - if you just run pip3 install adafruit-circuitpython-motorkit OP can run the script without sudo – bsautner Jun 17 '20 at 19:42