How can I find out where Python was installed in a Windows 11 machine, so that I can use the address to add Python to the PATH variable?
The documentation I have found on this assumes that the user can already use the python command in the cli. But in this case, the cli cannot find python yet because python has not been added to the PATH yet.
Also, I looked closely in Windows file explorer and was not able to find Python in Program Files, Program Files (x86), the root of the C drive, or any of the many other places that I looked.
Here are the commands that first install python and then try to check the resulting Python version.
PS C:\Users\Administrator> C:\temp\python-3.11.4-amd64.exe /passive InstallAllUsers=0 InstallLauncherAllUsers=0 PrependPath=1 Include_test=0
PS C:\Users\Administrator> python --version
python : The term 'python' 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
+ python --version
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\Administrator>
The /passive flag above results in the python install GUI launching while the install happens, and then closing without giving any error message, so it seems clear that the install command is indeed running. ... If you can suggest any alterations to the command to elucidate any possible error message, I would be happy to try your suggested fully automated commands that might leave better logs.
This is on an Amazon EC2 instance being accessed remotely using an RDP file, if that makes any difference. This provisioning process must be completely automated.
Powershell is running as an administrator while invoking the above commands.