I am trying to program a Feather M4 Express with an Ethernet Featherwing using Visual Studio Code. I am not sure if I don't have something, not set up correctly, but if I write something as simple as "import board", VS code gives the following error:
I don't know if the problem is in the way that I have VS code setup or not.
I have these extensions installed:
If I write the simple blink program, it will run it, but VS code still does not like it.
Visual Studio Code not recognizing CircuitPython librarys
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- LukeR
- Posts: 14
- Joined: Sun May 15, 2022 2:56 pm
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Visual Studio Code not recognizing CircuitPython library
I've not tried VScode myself, but it sounds as though you might have missed some of the necessary extension setup for the workspace or command run?
https://marketplace.visualstudio.com/it ... cuitpython
This links get into more details about the setup:
https://www.hanselman.com/blog/using-vi ... trellis-m4
https://marketplace.visualstudio.com/it ... cuitpython
This links get into more details about the setup:
https://www.hanselman.com/blog/using-vi ... trellis-m4
- LukeR
- Posts: 14
- Joined: Sun May 15, 2022 2:56 pm
Re: Visual Studio Code not recognizing CircuitPython library
I didn't see anything that I missed. the board library is the only one that I have found that does not work.
- adafruit2
- Posts: 22148
- Joined: Fri Mar 11, 2005 7:36 pm
Re: Visual Studio Code not recognizing CircuitPython library
you can run
import os
os.uname()
at the repl, to see what python you're running from
import os
os.uname()
at the repl, to see what python you're running from
- neradoc
- Posts: 542
- Joined: Wed Apr 27, 2016 2:38 pm
Re: Visual Studio Code not recognizing CircuitPython library
It looks indeed like you are running the code on the host PC, as shown by the "F:" path to the file.
This would happen if you click the green triangle at the top of the window. Is that what you did ?
I get the same message as you when I do that:
In Circuitpython you don't run the code like this, code.py runs automatically on start and reruns when you save (or do ctrl-C/ctrl-D in the serial console).
To see the output of your code, you connect to the board's serial console by selecting a COM port with the button at the bottom of the screen (when the extension is active).
You can also use an external app for serial connection like Tera Term
Leading to this panel (I selected the trinket's port, which is why it became the selected board at the bottom)
This would happen if you click the green triangle at the top of the window. Is that what you did ?
I get the same message as you when I do that:
In Circuitpython you don't run the code like this, code.py runs automatically on start and reruns when you save (or do ctrl-C/ctrl-D in the serial console).
To see the output of your code, you connect to the board's serial console by selecting a COM port with the button at the bottom of the screen (when the extension is active).
You can also use an external app for serial connection like Tera Term
Leading to this panel (I selected the trinket's port, which is why it became the selected board at the bottom)
- LukeR
- Posts: 14
- Joined: Sun May 15, 2022 2:56 pm
Re: Visual Studio Code not recognizing CircuitPython library
I am not sure exactly what fixed my problem, but it is working now. Thanks for the help.
A bit off-topic, but does anyone know how to set up ethernet for a local network? I need to define a specific port and the server IP address. The only examples that I have been able to find have used a website URL, and don't define a port. This will not work for my application.
A bit off-topic, but does anyone know how to set up ethernet for a local network? I need to define a specific port and the server IP address. The only examples that I have been able to find have used a website URL, and don't define a port. This will not work for my application.
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Visual Studio Code not recognizing CircuitPython library
LukeR,
Please start a new thread for the ethernet question.
Please start a new thread for the ethernet question.
Please be positive and constructive with your questions and comments.