Closed Mrqozy closed 1 year ago
@Mrqozy,
Hi. This gives very little to go off and I cannot help without more details. Please add logs as well as more context around what stubs you are using, what device you are using, your configuration, etc.
@Mrqozy,
Hi. This gives very little to go off and I cannot help without more details. Please add logs as well as more context around what stubs you are using, what device you are using, your configuration, etc.
im using micropython-esp32-stubs and almost every other stub give "print" is not defined" and "range" is not defined" error.
im using esp32
pymakr.conf { "address": "192.168.4.1", "username": "micro", "password": "python", "sync_folder": "src", "open_on_start": true, "safe_boot_on_upload": false, "py_ignore": [ "pymakr.conf", ".vscode", ".gitignore", ".git", "project.pymakr", "env", "venv", ".python-version", ".micropy/", "micropy.json" ], "fast_upload": false }
print and range are recognized after commenting out this line "python.analysis.typeshedPaths": [".micropy\micropython_esp32_stubs-1.19.1.post13", ".micropy\BradenM-micropy-stubs-4f5a52a\frozen", ".micropy\hhhh", "typings"],
full settings.json: { // Loaded Stubs: micropython-esp32-stubs
"python.languageServer": "Pylance",
"python.analysis.autoSearchPath": true,
"python.autoComplete.extraPaths": [".micropy\\micropython_esp32_stubs-1.19.1.post13", ".micropy\\BradenM-micropy-stubs-4f5a52a\\frozen", ".micropy\\hhhh"],
"python.analysis.diagnosticSeverityOverrides": { "reportMissingModuleSource": "none" },
// "python.analysis.typeCheckingMode": "basic",
"python.autoComplete.typeshedPaths": [".micropy\\micropython_esp32_stubs-1.19.1.post13", ".micropy\\BradenM-micropy-stubs-4f5a52a\\frozen", ".micropy\\hhhh", "typings"],
// "python.analysis.typeshedPaths": [".micropy\\micropython_esp32_stubs-1.19.1.post13", ".micropy\\BradenM-micropy-stubs-4f5a52a\\frozen", ".micropy\\hhhh", "typings"],
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.analysis.extraPaths": [
".micropy\\micropython_esp32_stubs-1.19.1.post13",
".micropy\\BradenM-micropy-stubs-4f5a52a\\frozen",
".micropy\\hhhh"
]
}
im getting many errors such as "Expected no arguments to "Pin" constructor"
Have you solved your problem? I have encountered the same thing.
Instead of using esp32-micropython-1.15.0
as the stubs of my project, I switch to the following:
"stubs": {
"micropython-esp32-stubs": "1.19.1.post13",
"micropython-stdlib-stubs": "0.9.0"
}
Everything works now. But I still have other problems.
im getting many errors such as "Expected no arguments to "Pin" constructor"
Have you solved your problem? I have encountered the same thing.
Like I mentioned comment these lines in the settings.json under the folder .vscode
For pwm error you can just type next to the error line #type: ignore
This will tell pylance to ignore the error.
It's not a perfect solution but it's a start, until now the creators of this resp. didn't reply again even after I provided the info they asked for.
Instead of using
esp32-micropython-1.15.0
as the stubs of my project, I switch to the following:"stubs": { "micropython-esp32-stubs": "1.19.1.post13", "micropython-stdlib-stubs": "0.9.0" }
Everything works now. But I still have other problems.
Can you use multiple stubs in one project?
im getting many errors such as "Expected no arguments to "Pin" constructor"
Have you solved your problem? I have encountered the same thing.
this is the fix, frequency is not positional argument but a keyword one
sorry for the mistake i just had to use a keyword argument for the frequency not a positional argument
Describe the bug im getting many errors such as "Expected no arguments to "Pin" constructor" led=Pin(2,Pin.OUT)
Expected 0 positional arguments even for print function!
Expected Behavior Pin requires positional arguments
Current Behavior im getting many errors such as "Expected no arguments to "Pin" constructor" led=Pin(2,Pin.OUT)
Steps to Reproduce
Possible Solution
Logs
Context (Environment)