Open rpgrunwald opened 1 year ago
This issue is unrelated to the extension. It's occurring due to the way the Pylance language server is configured; Pylance has no concept of CircuitPython or MicroPython and is attempting to treat what it has found in the same way as it would 'proper' Python. I had the same experience, and fixed it like this:
Analysis: Diagnostic Severity Overrides
to get straight to the correct settingEdit in settings.json
, which should take you to the correct part of the settings.json
file structure"python.analysis.diagnosticSeverityOverrides" : {
"reportShadowedImports": "none"
}
Hope that helps!
This might be a good thing to add to the extension docs. I ran into it as well.
According to the documentation:
CircuitPython looks for a code file on the board to run. There are four options: code.txt, code.py, main.txt and main.py. CircuitPython looks for those files, in that order, and then runs the first one it finds. While code.py is the recommended name for your code file, it is important to know that the other options exist.
So an arguably better solution is to name your main program file main.py
instead of code.py
. Then you'll still get (useful, IMO) warnings when you override modules but you won't have the problem reported here.
Much better solution (IMHO) is just to rename code.py to main.py: it won't conflict with the standard libraries & will still get run on boot.
Describe the bug Error message "h:\code.py" is overriding the stdlib module "code"
To Reproduce Steps to reproduce the behavior: Add CIRCUTPY drive with Open Folder Open code.py
Desktop (please complete the following information):
Additional context Adafruit Circuit Playground Express with adafruit-circuitpython-circuitplayground_express-en_US-7.3.3.uf2