I tried to update platformio by running ‘pio pkg update’ in the VSCode terminal and got this message:
Obsolete PIO Core v6.1.7 is used (previous was 6.1.9)
Please remove multiple PIO Cores from a system:
https://docs.platformio.org/en/latest/core/installation/troubleshooting.html
*********************************************************************************************************************************************************Resolving my_env dependencies...
Already up-to-date.
PS C:\Users\user\projects\daq\repo\controller\platformio>
I followed the instructions at Troubleshooting — PlatformIO latest documentation and run ‘pip uninstall platformio’ in my general shell and it indeed uninstalled the platformio package (I presume this is good). Platformio still functions in VSCode (build, debug, etc) but I cannot use the ‘pio’ command in the VSCode terminal anymore.
PS C:\Users\user\projects\daq\repo\controller\platformio> pio
pio : The term 'pio' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ pio
+ ~~~
+ CategoryInfo : ObjectNotFound: (pio:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Any suggestions on how to make pio available in the VSCode terminal the right way?
It sounds like you only have the PlatformIO IDE extensions installed. There are detailed docs on how to link those to be usable as commandline, ahem, commands.
It’s really just a simple method of adding the extension’s binaries to your PATH environment variable. On my Linux laptop, it was a simple export PATH=$PATH:/home/norman/.platformio/penv/bin in my .profile file.
Adding that path for the my general environment may also include things such as platformio specific python and pip, right? This can create problems such as which python env is updated when I run my my sell pip install.
Ideally I should be able to set the path just for the VSCode terminal, not for my general shell.
I’m not at my laptop, but, there are two terminals in VSCode. I think you might be using the “VSCode” one, you need the PlatformIO one. When you open a folder, or workspace, where there is a platformio.ini file, the Alien/Ant head toolbutton will be available on the left toolbar.
Click it to open the command list for PlatformIO. Somewhere on there is an opion to open a new terminal, use that one instead of the one offered by the VSCode main menu. The commandline commands should be available.
Sorry about being vague, I’m away from the laptop plus, my installation has my $PATH set globally.