VS Code Pymar microython
-
- Posts: 1
- Joined: Wed Jan 12, 2022 11:55 pm
VS Code Pymar microython
Hello everyone, I am taking up an old project that I have with an esp32. I want to do it with micropython, I configured everything to work with vscode, but I have a detail to solve.
It gives me a warning that I would like to solve, it does not affect the operation since it works perfectly.
from machine import Pin
A warning underline appears below the word machine. With the following text
Import "machine" could not be resolved
Can this be solved?
Thanks a lot
It gives me a warning that I would like to solve, it does not affect the operation since it works perfectly.
from machine import Pin
A warning underline appears below the word machine. With the following text
Import "machine" could not be resolved
Can this be solved?
Thanks a lot
-
- Posts: 4
- Joined: Sun Dec 19, 2021 2:45 pm
Re: VS Code Pymar microython
Hi programablearg. May I know how you have configured VS Code for micropython (i.e plugins or anything else.) ?
Re: VS Code Pymar microython
You can ignore the warning. The standard Python plugin for VS-Code knows CPython, but it does not know MicroPython.
-
- Posts: 4
- Joined: Sun Dec 19, 2021 2:45 pm
Re: VS Code Pymar microython
Yes Roberthh, you are right. That warning should be harmless. But I think there are some special plugins for VS Code to aid micropython development (eg - Micropython IDE, Pymakr). I think there should not be any warnings if such extensions are used, not exactly sure though, since I haven't tried these extensions.
Re: VS Code Pymar microython
The Pymakr IDE is for the Pycom variant of MicroPython. And pymakr is notoriously failing every month with a new VSCode release.
Re: VS Code Pymar microython
in order to get better language support for MicroPython in VScode, pylint, pycharm and others you can take a look at https://micropython-stubs.readthedocs.io/
Its not perfect, but I try to make it not wrong while still helping to write code simpler and with fewer errors.
allows you to select a specific version, port and board to check against, or use a simpler generic fallback.
Currently the initial setup requires you to clone the entire repo, working on making the installation of the type-stubs simpler by using type-packages.
Its not perfect, but I try to make it not wrong while still helping to write code simpler and with fewer errors.
allows you to select a specific version, port and board to check against, or use a simpler generic fallback.
Currently the initial setup requires you to clone the entire repo, working on making the installation of the type-stubs simpler by using type-packages.
Re: VS Code Pymar microython
@Robert, pymakr works fine with any port of micropython that exposes a serialport that has a driver on you Host platform.
and indeed , the Javascript serialport OSS library that is used has it's challenges in keeping up with the electron versions .
In the recent iterations Pycom has been much more responsive in fixing these issues though
and indeed , the Javascript serialport OSS library that is used has it's challenges in keeping up with the electron versions .
In the recent iterations Pycom has been much more responsive in fixing these issues though
Re: VS Code Pymar microython
Language and lint checking can be disabled for individual lines by appending "type: ignore" as a comment. For example:
This will also cause any machine.[*] call to not trigger a warning.
Checking for an entire file can be disable by putting the same as a line comment at the top of the file:
Code: Select all
import machine # type: ignore
Checking for an entire file can be disable by putting the same as a line comment at the top of the file:
Code: Select all
# type: ignore
Re: VS Code Pymar microython
With VS Code 1.74.1 and Ubuntu 22.04 only pymakr-preview 2.25.2 works.
Re: VS Code Pymar microython
Do you need to import the official machine, otherwise it may result in incompatible versions.