'Internal Server Error while using PlatformIO extension in VSCode

PlatformIO was working fine. All of a sudden it started showing Internal Server Error when clicking PIO Home-->Open

Other features like:

Update All

Core CLI works.



Solution 1:[1]

Entering pio home command in the PlatformIO Core CLI revealed the problem.

It showed module 'anyio' has no attribute 'to_thread' error.

I updated anyio to 3.5 and it sorted the problem.

Conclusion: This "all of a sudden" seems to be because of a switch from Python 3.10 to Python 3.8.3 which I had to do for another project at some point and 3.8.3 did not have the required anyio.

For anyone else bumping into this question with this same error trying

pio home

in the PlatformIO Core CLI may lead to a solution.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1