-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdlib: sys.print_exception is not known #770
Comments
Thanks for the report, What port and board are you using, and which type checker is reporting the issue ? If you are using mypy then it may be beyond its capabilities as it does not allow an alternative stdlib to be used |
I am using a raspberry pico w (1st gen) with vscode and pylance. I got the micropico extension for vscode. |
Same issue with esp8266 board, and pyright and basepyright checkers. Thanks! |
sorry for the delay in responding, Have you configured the correct path to https://micropython-stubs.readthedocs.io/en/main/22_vscode.html |
this is the content of my settings.json: {
"python.analysis.typeshedPaths": [
"~/.micropico-stubs/included"
],
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "basic",
"python.analysis.extraPaths": [
"~/.micropico-stubs/included"
],
"micropico.syncFolder": "",
"micropico.openOnStart": true,
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.analysis.diagnosticSeverityOverrides": {
"reportMissingModuleSource": "none"
},
"python.linting.enabled": true,
"python.terminal.activateEnvironment": true
} when I manually search for the file, it is located at But if I actually use import sys
sys.print_exception() and right click the sys -> goto definition, I would end up in Header of """
System specific functions.
MicroPython module: https://docs.micropython.org/en/v1.23.0/library/sys.html
CPython module: :mod:`python:sys` https://docs.python.org/3/library/sys.html .
---
Module: 'sys' on micropython-v1.23.0-rp2-RPI_PICO_W
"""
# MCU: {'build': '', 'ver': '1.23.0', 'version': '1.23.0', 'port': 'rp2', 'board': 'RPI_PICO_W', 'mpy': 'v6.3', 'family': 'micropython', 'cpu': 'RP2040', 'arch': 'armv6m'}
# Stubber: v1.23.0 Header of """
System specific functions.
MicroPython module: https://docs.micropython.org/en/v1.23.0/library/sys.html
CPython module: :mod:`python:sys` https://docs.python.org/3/library/sys.html .
""" |
I should have added the information that I am working with the paulober/micropico extension, that did the setup for me |
See my previous comment, while the sys.pyi file actually does exist, it would point me to |
one one hand it is clear that it exists - on the other hand it can't be found.
@paulober , I think you have experimented with some different settings for the |
I was able to repo the same issue. I don't remember why we need the I was able to solve the issue by adding following setting: "python.analysis.stubPath": "~/.micropico-stubs/included" Removing the |
Thanks Paul, The tools behaviour and settings change over time. Maybe I should add that to the test suite, if that is indeed a supported config by pyright. I'm currently redesigning the stdlib stubs, so would worth checking |
When calling
I get the error message, that
print_exception
is not known - but it works fine when running on Micropython 1.23. So it seems like the stub is missing.The text was updated successfully, but these errors were encountered: