Hello! I'm somewhat new to using Circuit Python. I tend to use VS Code for writing my code and use the Mu serial console to watch the output. The other day my program was displaying in VS code normally. I shut off the computer over the weekend, and today I came back to the program without changing anything and this problem appears over the entire code and over the entire secrets.py file as well:
It doesn't appear to actually impact the function of the code, but it's visually kind of annoying to look at and I'm not sure if there's actually an issue I should address. I've tried various troubleshooting steps such as rebooting the computer, unplugging and plugging back in the board, removing the files from the workspace and adding them again, updating Python on my computer, and uninstalling then reinstalling VS code. None of this has solved this issue.
Matrix Portal M4 - VS Code "code.py is overriding the stdlib module "code"
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- ceb2120
- Posts: 10
- Joined: Fri Oct 14, 2022 1:33 pm
- adafruit_support_carter
- Posts: 29056
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Matrix Portal M4 - VS Code "code.py is overriding the stdlib module "code"
It appears related to the Pylance plugin griping about the imports, specifically from the reportShadowedImports feature. You can probably generally ignore those and treat them as warnings. If you want to get rid of those notices, you'll need to configure Pylance.
Maybe related?
https://github.com/microsoft/pylance-re ... ssues/2537
Maybe related?
https://github.com/microsoft/pylance-re ... ssues/2537
- ceb2120
- Posts: 10
- Joined: Fri Oct 14, 2022 1:33 pm
Re: Matrix Portal M4 - VS Code "code.py is overriding the stdlib module "code"
Thank you for your feedback! I was able to solve the problem by adding "reportShadowedImports": "none" into the settings.json folder under "python.analysis.diagnosticSeverityOverrides"
I also found this StackOverflow post with the same problem, it looks like VS code just added this check in which is why it only just started happening? At least based on what the post says. https://stackoverflow.com/questions/746 ... e-pylancer
I also found this StackOverflow post with the same problem, it looks like VS code just added this check in which is why it only just started happening? At least based on what the post says. https://stackoverflow.com/questions/746 ... e-pylancer
- danhalbert
- Posts: 4615
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Matrix Portal M4 - VS Code "code.py is overriding the stdlib module "code"
CircuitPython will run `main.py` if `code.py` is not present.
Please be positive and constructive with your questions and comments.