ValentinDP
ValentinDP

Reputation: 323

ImportError: No module named adafruit_motor

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+

Upvotes: 3

Views: 3563

Answers (1)

ddor254
ddor254

Reputation: 1628

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

like this: sudo python3 motortest.py

Upvotes: 2

Related Questions