I am trying to develop a project on Windows 10.
I haven’t used Platformio on Windows for some time now and I can’t get it to work. I can’t run commands from the terminal, I can’t even run commands from the toolbar. It’s pretty much very broken. Please send help.
It is a fresh Platformio IDE install so everything should be up to date.
I’ve edited the system environment variable like so:
Can you run pio from a normal commandline (Windows + R → cmd.exe)?
Is it possible to open a PIO terminal and use pio there?
In recent VSCode extension settings, the behavior of the global shell environment of VSCode was changed to not have PlatformIO and python accessible anymore, because it may pollute existing system environments. See release page regarding 2.1.2.
Actually if you need PlatformIO globally I would suggest a global install as well. What you’re doing now by including the C:\Users\<user>\.platformio\penv\Scripts\ path is adding the path to PlatformIO’s own supposedly isolated Python installation to your whole system path – this will also conflict with existing Python installations if you have any.
The recommended way to install PlatformIO globally (if above doesn’t work), is to:
first do a clean uninstall of the current PlatformIO
uninstall the PlatformIO VSCode extension
back any data you may have locally modified in C:\Users\<user>\.platformio\, e.g. packages or platforms – skip if you’ve never done anything in there
remove the entire
make sure you have a systemwide halfway recent Python 3 installed (open cmd, do python3 --version; mine is 3.7.7 currently, though 3.8.x is recommended). Otherwise download Python 3.8 and check the “Add to PATH” option in the installer.
Install PlatformIO globally either by doing a pip3 install platformio in the cmd, or, follow the FAQ
Check whether the Scripts folder of you Python3 installation is in the PATH. Mine is C:\Users\<user>\AppData\Local\Programs\Python\Python37\Scripts\ and you might have to do something similiar
executing pio in the cmd.exe should now fully work (if not, restart the computer so that the PATH change takes effect)
Please remove PlatformIO from your system environment variables. It looks like you have multiple PlatformIO Cores in the system. The pio command does not work because you use a VERY OLD PlatformIO Core.
The recommended way to install PlatformIO globally (if above doesn’t work), is to:
first do a clean uninstall of the current PlatformIO
uninstall the PlatformIO VSCode extension
back any data you may have locally modified in C:\Users\<user>\.platformio\ , e.g. packages or platforms – skip if you’ve never done anything in there
remove the entire
make sure you have a systemwide halfway recent Python 3 installed (open cmd , do python3 --version ; mine is 3.7.7 currently, though 3.8.x is recommended). Otherwise download Python 3.8 and check the “Add to PATH” option in the installer.
Install PlatformIO globally either by doing a pip3 install platformio in the cmd , or, follow the FAQ
Check whether the Scripts folder of you Python3 installation is in the PATH. Mine is C:\Users\<user>\AppData\Local\Programs\Python\Python37\Scripts\ and you might have to do something similiar
executing pio in the cmd.exe should now fully work (if not, restart the computer so that the PATH change takes effect)
I did that and I can run pio in cmd and in VSC terminal.
I can also run any of the commands from the PIO toolbar.
I am trying to figure our which command is for build. pio run -t build returns:
*** Do not know how to make File target `build' (D:\Projects\PlatformioIDE Projects\ESP_TimerOnInput-main\build). Stop.
A normal build is justpio run. Uploading is pio run -t upload. You can list all available targets by doing a pio run --list-targets (also see pio run --help in general).