Cannot install platformio ide, python not found even I do have python 3.8.8 installed

I tried to re-install PlatformIO on my machine. the previous install just got corrupted.
But when I install it , it gave me below error message (I was on win10):

    Error: Error: Could not find compatible Python 3.6 or above in your system.Please install the latest official Python 3 and restart installation:
https://docs.platformio.org/page/faq.html#install-python-interpreter
 -> Installer version: 1.0.3
Platform: Windows-10
Python version: 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)]
Python path: C:\ProgramData\Anaconda3\python.exe
Creating a virtual environment at C:\Users\zheng\.platformio\penv

	at c:\Users\zheng\.vscode\extensions\platformio.platformio-ide-2.3.3\node_modules\platformio-node-helpers\dist\index.js:1:771390
	at ChildProcess.a (c:\Users\zheng\.vscode\extensions\platformio.platformio-ide-2.3.3\node_modules\p...

I tried uninstall platformIO, VSCODE and anaconda completely, remove every bit of them.

But after reinstall them, PlatformIO install still gave me the above error message.

I already googled this issue for about a whole day.
I definitely don’t want to re install my OS. Do you guys know how to solve this?

Anaconda is known to heavily break PlatformIO installations.

Can you try it without?

Thank you very much.
I just tried installing python downloaded from official python site. It worked.

But my old problems came back:
In the project tasks, I have 2 environments, but the tasks stuck at loading nothing showed up.
The default tasks are not working. When you clicked one of them, it just prints lots of “-” in the terminal.

I tried to uninstall and reinstall PlatformIO, but it stuck at installing platformio core.

Are you only have 1 PlatformIO core installed now? Nothing installed via the system pip etc?

What’s the exact output of pio run / “Build” when building the standard Arduino Blink example?

Yes, I have only 1 PlatformIO core installed via vscode extension.

I then manually added %userprofile%.platformio\penv\Scripts to PATH and run the cli command.

the output is:

Processing uno (platform: atmelavr; framework: arduino; board: uno)
------------------------------------------------------------------------------------------------------------------------
Platform Manager: Installing atmelavr
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: atmelavr @ 3.4.0 has been installed!
The platform 'atmelavr' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.

and it stuck there.

In my project when I clicked build all it’s similar.

Processing STM32F103RC (platform: ststm32; board: genericSTM32F103RC; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Platform Manager: ststm32 @ 14.2.0 iPlatform Manager: ststm32 @ 14.2.0 is already installed
The platform 'ststm32' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.

I have stem32 Espressif 32 and Atmel AVR platform installed.

Can you open a CLI and show the output of

pio platform install atmelavr --with-package framework-arduino-avr --with-package toolchain-atmelavr --with-package tool-avrdude

?

You are such a genius.
When I run the above command, it give me:

Platform Manager: atmelavr @ 3.4.0 is already installed
Tool Manager: Installing platformio/toolchain-atmelavr @ ~1.70300.0
Error: HTTPSConnectionPool(host='api.registry.ns1.platformio.org', port=443): Max retries exceeded with url: /v3/packages/platformio/tool/toolchain-atmelavr (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000028DAB4E4AF0>, 'Connection to api.registry.ns1.platformio.org timed out. (connect timeout=10)'))

It seems a network problem, as in my area there is “something” block part of the internet.

I connects to an vpn in un-restricted area, it installed ok with:

Platform Manager: atmelavr @ 3.4.0 is already installed
Tool Manager: Installing platformio/toolchain-atmelavr @ ~1.70300.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: toolchain-atmelavr @ 1.70300.191015 has been installed!
Tool Manager: Installing platformio/framework-arduino-avr @ ~5.1.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: framework-arduino-avr @ 5.1.0 has been installed!
Tool Manager: Installing platformio/tool-avrdude @ ~1.60300.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-avrdude @ 1.60300.200527 has been installed!
The platform 'atmelavr' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.

Then, the build was successful, but the above too a bit long, about 5 mins.

I then opened vscode, the task in my STM32 environment loaded after a long time, more than 40 mins. And I can build the stm32 project. But the ESP32 environment stuck at loading.

I closed vscode and restart it, both environment stuck at loading.

Is it the internet problem? Can I use a HTTP proxy? My vpn is somehow very unstable.

Looks so to me if it works without VPN. Something is blocking something.

Yes, see PlatformIO IDE for VSCode — PlatformIO latest documentation.

The toolchain and framework is very big, try with

pio platform install espressif32 --with-package framework-arduinoespressif32 --with-package toolchain-xtensa32 --with-package tool-esptoolpy

as a few base-packages.

Thank you very much. It solved my problems.
After a set the http proxy, tasks load fine.
The only thing that is not perfect is the tasks load took a few mins every time I changed the platformio.ini file. Is it normal? I don’t remember this behavior on my previous setup.

A few minutes is not normal, maybe 10-20 seconds maximum when you do minor changes to the platformio.ini. If you change it to e.g. switch do a different platform version or edit platform_packages it surely takes longer though, depending on the download size.