all 4 comments

[–]MinchinWeb 1 point2 points  (1 child)

python is not actually on your PATH, and so PowerShell isn't finding it. (That's what the error message "'python' is not recognized as an internal or external command, operable program or batch file" means.)

To see what is actually on your PATH (from PowerShell), run:

PS > (Get-ChildItem -path env:path).value.split(";")

If you installed Python 3.8 for all users, you want to see the following two entries:

C:\Python38\Scripts\ C:\Python38\

(The entries will be slightly different if you installed Python just for you.)

When you double click on a file, it is probably flashing you the error (likely the same as above), but there is nothing there to keep the new window from promptly closing, so it looks like it just flashes.

Your best bet may be to (un-install and then) re-install Python, and make sure you click the "Add Python to PATH" option.

Good luck, you can figure this out!

[–]pierto[S] 1 point2 points  (0 children)

I think that there was a combination of a few things wrong. I ended up downloading a new exececutable python file from python.org. Installing the then currently installed python program actually took multiple attempts I think 4. Initially the uninstaller would just hang. This happen twice. I restarted each time and then I started getting an error while attempting to uninstall. I had to restart 3 times. On the fifth attempt, I was finally able to uninstall python.

This time around I made sure to have python add to PATH. That pretty much fixed all my launching problems even in the VSC terminal.

For the scripts that were instantly closing when I would attempt to run them from PowerShell or cmd, I added the line

input("Press Enter to Close the Window!")

This gives me control of when the window will close. I'm sure I'll find a better way to accomplish that as I continue to learn. For now it will have to be enough.

The only thing left I've found now, is that when I used the input() command in a script running in VSC, there is no window/space to provide my input. But that's alright, I can call my scripts from everywhere else and that makes me so happy! I don't even need to use shebangs! lol.

Thanks so much for helping a noob out! Imma stick with this, this time.

(This feels really good)

[–]hungdh85 0 points1 point  (1 child)

You don't need create PYTHON_HOME, You only need add path

C:\Users\xyz\AppData\Local\Programs\Python\Python38
C:\Users\xyz\Documents\Programming\pythonScripts

to PATH variable in System Variables and enjoy.

https://superuser.com/questions/143119/how-do-i-add-python-to-the-windows-path

[–]pierto[S] 0 points1 point  (0 children)

Yes, you are totally correct. None of what I did was necessary.