0

ModuleNotFoundError: No module named 'busio'
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ModuleNotFoundError: No module named 'busio'

by Giv on Thu Mar 18, 2021 8:08 pm

Hi,
I am working with the Grand Cenral M4 board and CircuitPython. I am loading the example "sd_read_simpletest.py" file into the PyCharm Community Edition 2020.3.4 to run, but I keep getting the above error messages "ModuleNotFoundError: No module named 'busio'". I get the same error message on 'Thonny';;

import busio
ModuleNotFoundError: No module named 'busio'


Let me know please.

Regards.

Giv
 
Posts: 15
Joined: Sat Aug 06, 2016 1:52 pm

Re: ModuleNotFoundError: No module named 'busio'

by dastels on Thu Mar 18, 2021 8:31 pm

Are you sure you are running the code in CircuitPython on the Grand Central? The busio module is part of CircuitPython. It's always there.

Dave

dastels
 
Posts: 6431
Joined: Tue Oct 20, 2015 3:22 pm

Re: ModuleNotFoundError: No module named 'busio'

by Giv on Fri Mar 19, 2021 10:48 pm

Hi,
Yes, please see screen shot attached. You see the drive circuitpy "E:" and Thonny screen with the error message;

That is Not the only issue. I have had no luck in accessing the SD card on the Grand Central M4 with Circuitpy or Arduino. Dcoumentation is minimal. Help please.

Thanks.
Givi
Attachments
Screenshot-busio.jpg
Screenshot-busio.jpg (396.33 KiB) Viewed 78 times

Giv
 
Posts: 15
Joined: Sat Aug 06, 2016 1:52 pm

Re: ModuleNotFoundError: No module named 'busio'

by dastels on Sat Mar 20, 2021 12:26 pm

No, as the screenshot shows.

I don't really understand the Windows drive stuff, but you are not running the code in CircuitPython on the GrandCentral. It would have to be directly on CIRCUITPY, named with code.py or main.py.

Also, if the error was coming from CircuitPython it would look like:
Code: Select all | TOGGLE FULL SIZE
>>> import blah                                                                 
Traceback (most recent call last):                                             
  File "<stdin>", line 1, in <module>                                           
ImportError: no module named 'blah'


Also, the error pane also says
Code: Select all | TOGGLE FULL SIZE
"Python 3.7.9" (bundled)
, meaning the code is running in the Python that's part of Thonny.

As for using the SD card, see https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/circuitpython for details on using it from CircuitPython. The grand Central has ,a separate, dedicated SPI bus for the SD card, so when you construct the busio.SPI object, use: SD_CS, SD_MISO, SD_MOSI, and SD_SCK from the board module. In C++ use SPI1 to connect to the card which will be used automatically by the SD library
. See https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/arduino-library.

Dave

dastels
 
Posts: 6431
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.