> python --version
Python 3.9.1
PS D:\Users\Nurquhar\Documents\NuSoftLtd\Projects\RoutesReports\NR-MPV-SITT-RHTT-Jan2020\Software\RR-TTM-NR-release-build-trial> pio system info
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 system info
+ ~~~
+ CategoryInfo : ObjectNotFound: (pio:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS D:\Users\Nurquhar\Documents\NuSoftLtd\Projects\RoutesReports\NR-MPV-SITT-RHTT-Jan2020\Software\RR-TTM-NR-release-build-trial>
If you have installed PlatformIO extensions into VSCode, then you will not be able to see the pio or platformio commands in a shell outside of VSCode.
In addition, if you use VSCodeās Terminal->New Terminal option, the commands will not be available there either!
To use them, Click on the PlatformIo icon on the left side toolbar (Ant/Alien head), then in the Quick Access list that appears, under Miscellaneous, choose New Terminal.
Now you should be able to use the commands.
My best advice is to follow the instructions at Redirecting... to add the pio and platformio commands to your normal shell/command line sessions. That way, every terminal you open, inside or outside of VSCode, will have the commands available.
Some people have had problems with Python 3.9 not working correctly. If you find any problems, try using the āportableā version of Python that PlatformIO installs when you install into VSCode.
Open VSCode, then CTRL+comma. That will take you to settings. Search for āportableā and you should find one hit: āUse a portable Python 3 interpreter if availableā. Tick/check the option and PlatformIO in VSCode will use the downloaded, and known to work, version of Python 3.x instead of any external versions installed outwith VSCode.
I have a few applications that use python so when I did a search of C:\ I found I had a dozen or more copies installed in all sorts of places. So I remove via control panel all copies I thought I had installed myself. I then installed python using the windows app store, which put the 3.9.1 on my PC where ever it liked.
When I tried installing from a python a download exe platformio could not see it, it just found my python 2.7 which I have also removed. But it could see it with the version installed from the app store. I think this hassle may be related to my PC busting through the 1024 char limit for the path variable. I tried the registry hacks to increase this but it did not seem to work.
All seems to be working for me at the moment with 3.9.1 but if I get further hassle perhaps I can downgrade to 3.8 or 3.7
For PlatformIO you shouldnāt need to downgrade the system wide version on Python, just set the option I described above to use the PlatformIO built in version. I think thatās 3.6.x at the moment. The reason Iām not sure is because on my Linux system, it has sym-linked to the 3.6.7 version that is installed system wide.
Norm, you are a bloody legend mate! I have been tearing my hair out trying to figure this out. Even reinstalled windows. I wish I had seen you post earlier but thanks for posting this. Cheers.
I am having the same issue. I did try the above suggestions.
I am running on Ubuntu 22.04, with Python 3.10.12 installed. My default shell is zsh with .oh-my-zsh enabled. Now when I open Ubuntu Terminal, I see above python version, and PS1 prompt shows git branch when I enter any git projects.
On the other end, after installing VSC and adding platformio, when I click on āAlienā and select Miscellaneous and select eather āPlatformIO Code CLIā or āNew Terminaā, I see this prompt in open terminal:
wbox ā ecd $(git_prompt_info)
where wbox is hostname, ecd is git project I am starting to work on, and $(git_prompt_info) should be replaced with git branch, like it is in Ubuntu Terminal.
Now, if I run pio --help get not found.
wbox ā ecd-gps $(git_prompt_info)pio --help
zsh: command not found: pio
EDIT: Since $(git_prompt_info) is not evaluated and not sure why, there was no space above between )pio .
wbox ā ecd-gps $(git_prompt_info) pio --help
After I added space ) pio it works. But on next run and I remove the space, it still works. Weird.
Have you followed the instructions here? It appears other people have had zsh problems too. Git_prompt_info looks like a function you need to declare in your shell, or in your zsh equivalent to .profile or .bashrc:
# Get the name of the branch we are on
git_prompt_info() {
branch_prompt=$(__git_ps1)
if [ -n "$branch_prompt" ]; then
status_icon=$(git_status)
echo $branch_prompt $status_icon
fi
}
It would need to be globally available to have it in all zsh sessions. I note also that most of the compalins about it not working are down to __git_ps1 not being found. There are solution(s) on the page I linked.