problem using a library

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Elektrix
 
Posts: 19
Joined: Wed Dec 26, 2018 6:11 am

problem using a library

Post by Elektrix »

Hello all,

I run CircuitPython 7.3.1 on a Feather M0 Express. I installed the adafruit_logging library from the latest release. When I import this library in the main file code.py everything is ok:

Code: Select all

import adafruit_logging as logging
gives no error.

Then, I created a file morse.py in the lib folder and I want to import the logging library in the morse.py file. So in this file I wrote:

Code: Select all

import adafruit_logging as logging
and I wrote

Code: Select all

import morse
in code.py. But this gives me an errror:

Code: Select all

code.py Ausgabe:
Zurückverfolgung (jüngste Aufforderung zuletzt):
  Datei "code.py", Zeile 4, in <module>
OSError: [Errno 5] Eingabe-/Ausgabefehler
CircuitPython runs in German as I am not a native English speaker.

The rest of the code from my morse.py runs fine. What am I doing wrong?

Thanks in advance

Elektrix

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: problem using a library

Post by dastels »

It's likely because morse.py is in the CIRCUITPY/lib folder. Have you tried moving it to CIRCUITPY?

Dave

User avatar
Elektrix
 
Posts: 19
Joined: Wed Dec 26, 2018 6:11 am

Re: problem using a library

Post by Elektrix »

Thank you for your hint! I moved the morse.py file into the main folder and back to try out what you wrote and to replicate the error. When the morse.py file is in the lib folder everything works as expected. This was not the case in the beginning. In the meantime I did a full hardware reset and power disconnect to the feather and since then in works. Probably I should have done a full hardware reset after the installation of the logger library.

Thank you very much

Elektrix

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: problem using a library

Post by dastels »

Sounds like something got cached.

Dave

User avatar
Elektrix
 
Posts: 19
Joined: Wed Dec 26, 2018 6:11 am

Re: problem using a library

Post by Elektrix »

Finally, I found the real error. The error described above appeared again. I erased and formatted the CIRCUITPY drive using the REPL console as described in the pdf tutorial. I loaded my files and the library again. Now everything is fine. Looks like the filesystem was corrupted.

Elektrix

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”