How to change library version in migrated Arduino project?

I have just installed VsCode + PlatformIO on my laptop.
I have an old esp8266 project from 2018 developed with Arduino using the IDE Sloeber (an Eclipse plug-in) which I want to transfer to PlatformIO.

So I have started a new project using the board ESP-07S and generic esp8266 library.
While doing so I selected the latest version of the library (which was stupid in retrospect).
I copied in all the source files from the old project into src and include directories and changed the name of the old ino file to main.cpp.
PlatformIO recognizes the project but there are a few flagged errors, which I believe are caused by the library version used. In the old project it was 2.4.1 or 2.4.2, but PlatformIO has 4.0.1…

Now with the project loaded I want to change the library to the 2.x.x version closest to what I had back in 2018.
But how do I do that?
I have searched the UI of PlatformIO again and again and I cannot find where I can even load a new library into the project let alone show the existing one or change its version.

Please advice how to manage the libraries used by the loaded project!

EDIT:
This is the content of the platform.ini file of the project:

[env:esp07s]
platform = espressif8266
board = esp07s
framework = arduino

And there are no files inside the lib directory except for the README file.
I expected the library/board files to be here after specifying them when creating the project…

EDIT2:
The errors I get are present also after uninstalling 4.0.1 and installing 2.4.0.
Here is one example:
Cannot open source file Arduino.h
and
Cannot open source file ESP8266WebServer.h
They were not there before I uninstalled library 4.0.1 and then installed 2.4.0