PIO (VScode) Arduino UNO no Ethernet.h

I am using almost all of my Arduino UNO with the 5100 Ethernet shield.
I moved my projects from ATOM to VScode, and can no longer #include <Ethernet.h> without getting a wiggly line, and erro that Ethernet.h cannot be found.

How can I get this library for the UNO?
Ethernet.h files are in C:\Users\MaxG\.platformio\packages\framework-arduinoavr\libraries\__cores__\MegaCore\Ethernet\src and a few others.

I have no idea why it worked in PIO on ATOM, considering PIO has the same file structure.

Do I have to add a dependency in platformio.ini in the relevant project folder?
This was not required under ATOM.

Adding:
lib_deps = Ethernet@^2.0.0
in platformio.ini seems to have fixed this problem.

3 Likes