0

ImportError: No module named 'board'
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

ImportError: No module named 'board'

by LcNessie on Fri Jan 11, 2019 6:01 am

Hello,

I'm trying to have my RPi talk to a PWA9685 servo board, but I seem to be running into a problem.
When following the tutorials, the instructions tell me to use pip3 to install a couple of adafruit libraries. This seems to work without problem.
Code: Select all | TOGGLE FULL SIZE
sudo pip3 install adafruit-circuitpython-pca9685
sudo pip3 install adafruit-circuitpython-motor

However, when I want to run the python script ( making sure to use python3), the following error appears:

Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
    File "servoController_i2c.py: , line 21, in <module>
        from board import SCL, SDA
ImportError: No module named 'board'


I assume that module 'board' should have been pre-installed or have been dragged along with the other adafruit libraries. Using pip3 install to get 'board' results in the installation of a completely unrelated 'board', something to do with checkers, I believe.

- Where do I find the correct 'board' module?
- Is there a way to install this module manually?
- What is behind SDA and SCL? Are they just pre-defined numbers, or are there embedded functions? Could I just substitute them with an integer? If yes, which ones?

LcNessie
 
Posts: 2
Joined: Fri Jan 11, 2019 5:56 am

Re: ImportError: No module named 'board'

by LcNessie on Fri Jan 11, 2019 8:57 am

Although the original problem technically still persists, it seems I have found another way to talk to the controller with the tutorial found under the product page for the 12 bit 16 channel servo board.
Using the tutorial https://learn.adafruit.com/adafruit-16- ... spberry-pi, I was able to control my servos. I like that solution as well, as it is a bit more bare-bones.

LcNessie
 
Posts: 2
Joined: Fri Jan 11, 2019 5:56 am

Re: ImportError: No module named 'board'

by adafruit_support_mike on Sat Jan 12, 2019 6:34 am

The 'board' module should be part of CircuitPython.

If you're using the standard Pyhton interpreters, you'll want these modules instead:

https://github.com/adafruit/Adafruit_Python_PCA9685
https://github.com/adafruit/Adafruit-Mo ... on-Library

adafruit_support_mike
 
Posts: 57354
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.