Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

Import Error at IO Smart Planter
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Import Error at IO Smart Planter

by berkozz on Sun May 16, 2021 6:44 am

There is an error code on my panel like this:

Auto-reload is on. Simply save files over USB to run them or enter REPL to disab le.

Press any key to enter the REPL. Use CTRL-D to reload.soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disab le.
code.py output:
Traceback (most recent call last):
File "code.py", line 15, in <module>
File "adafruit_pyportal/__init__.py", line 33, in <module>
File "adafruit_pyportal/network.py", line 31, in <module>
File "adafruit_portalbase/network.py", line 29, in <module>
ImportError: no module named 'adafruit_fakerequests.Fake_Requests'

I found this file in the folder (adafruit_fakerequests) but it doesn't see this file. How can I solve this problem ?

berkozz
 
Posts: 12
Joined: Mon May 10, 2021 8:08 am

Re: Import Error at IO Smart Planter

by adafruit_support_carter on Tue May 18, 2021 2:54 pm

Is the file adafruit_fakerequests.py located in the lib folder of your CIRCUITPY drive? Like this:

CIRCUITPY/lib/adafruit_fakerequests.py

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Import Error at IO Smart Planter

by berkozz on Wed May 19, 2021 4:34 pm

adafruit_support_carter wrote:Is the file adafruit_fakerequests.py located in the lib folder of your CIRCUITPY drive? Like this:

CIRCUITPY/lib/adafruit_fakerequests.py

yes it is.

Adsız.png
Adsız.png (180.63 KiB) Viewed 339 times

berkozz
 
Posts: 12
Joined: Mon May 10, 2021 8:08 am

Re: Import Error at IO Smart Planter

by adafruit_support_carter on Thu May 20, 2021 1:54 pm

Not seeing it? Scroll up maybe?

There are two different files: adafruit_fakerequests.mpy and adafruit_requests.mpy.

In general, you want to have the .mpy versions in your lib folder.

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Import Error at IO Smart Planter

by berkozz on Fri May 21, 2021 6:07 am

adafruit_support_carter wrote:Not seeing it? Scroll up maybe?

There are two different files: adafruit_fakerequests.mpy and adafruit_requests.mpy.

In general, you want to have the .mpy versions in your lib folder.


There are fakerequest and request files.
Attachments
Adsız.png
Adsız.png (180.63 KiB) Viewed 324 times
1.png
1.png (181.08 KiB) Viewed 324 times

berkozz
 
Posts: 12
Joined: Mon May 10, 2021 8:08 am

Re: Import Error at IO Smart Planter

by adafruit_support_carter on Fri May 21, 2021 11:03 am

It looks like you are ending up with both .py and .mpy versions of some of the library files. How are you downloading the libraries and installing them to the CIRCUITPY drive?

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Import Error at IO Smart Planter

by berkozz on Fri May 21, 2021 2:52 pm

adafruit_support_carter wrote:It looks like you are ending up with both .py and .mpy versions of some of the library files. How are you downloading the libraries and installing them to the CIRCUITPY drive?

I think I accidentally copied adafruit-circuitpython-bundle-py-20210507's files into the lib folder

berkozz
 
Posts: 12
Joined: Mon May 10, 2021 8:08 am

Re: Import Error at IO Smart Planter

by adafruit_support_carter on Mon May 24, 2021 1:09 pm

OK, that could be part of it. Go ahead and just start over with your lib folder. Just delete everything there and copy back over from a bundle file downloaded from here:
https://circuitpython.org/libraries
It should only contain .mpy versions, which is what you want.

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Import Error at IO Smart Planter

by berkozz on Mon May 24, 2021 2:52 pm

adafruit_support_carter wrote:OK, that could be part of it. Go ahead and just start over with your lib folder. Just delete everything there and copy back over from a bundle file downloaded from here:
https://circuitpython.org/libraries
It should only contain .mpy versions, which is what you want.

I did what you said. now I have this :)

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

code.py output:
No SD card found: no SD card
drawing background..
loading fonts...
Traceback (most recent call last):
File "code.py", line 132, in <module>
File "adafruit_bitmap_font/bdf.py", line 167, in load_glyphs
MemoryError: memory allocation failed, allocating 472 bytes

Code done running.

berkozz
 
Posts: 12
Joined: Mon May 10, 2021 8:08 am

Re: Import Error at IO Smart Planter

by adafruit_support_carter on Mon May 24, 2021 3:16 pm

What board are you running this on? That looks like a running out of memory error :(

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Import Error at IO Smart Planter

by berkozz on Tue May 25, 2021 1:59 am

adafruit_support_carter wrote:What board are you running this on? That looks like a running out of memory error :(

You mean circuitphyton version ? It is 6.2.0

berkozz
 
Posts: 12
Joined: Mon May 10, 2021 8:08 am

Re: Import Error at IO Smart Planter

by adafruit_support_carter on Tue May 25, 2021 1:42 pm

The main board - like a Feather M4 Express? A Trinket M0? etc?

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Import Error at IO Smart Planter

by berkozz on Wed May 26, 2021 1:22 am

adafruit_support_carter wrote:The main board - like a Feather M4 Express? A Trinket M0? etc?

Pyportal Titano

berkozz
 
Posts: 12
Joined: Mon May 10, 2021 8:08 am

Re: Import Error at IO Smart Planter

by adafruit_support_carter on Wed May 26, 2021 11:33 am

Hmmm. A Titano shouldn't have any issues with that code. Just to be sure, this is the code you are trying to run?
https://learn.adafruit.com/pyportal-pet ... code-setup

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Import Error at IO Smart Planter

by berkozz on Wed May 26, 2021 1:52 pm

adafruit_support_carter wrote:Hmmm. A Titano shouldn't have any issues with that code. Just to be sure, this is the code you are trying to run?
https://learn.adafruit.com/pyportal-pet ... code-setup

yes it is.. If I insert a sd card, will the problem be fixed?

berkozz
 
Posts: 12
Joined: Mon May 10, 2021 8:08 am

Please be positive and constructive with your questions and comments.