0

I'm having a hard time understanding and running a terminal. I downloaded python 3.11 from the official website and installed it. I also checked the box at the beginning of the installment to add python to PATH. But when I try to run it on git bash it just gives me an empty line. On Visual code, It takes to download python through the Microsoft store. But is it makes sense to download it twice, through the website and through the store...?

git bash picture:
git bash picture

visual code terminal picture:
visual code terminal picture

starball
  • 20,030
  • 7
  • 43
  • 238
Dank
  • 1
  • 1

1 Answers1

0

On Visual code, It takes to download python through the Microsoft store

If my understanding is correct, Windows comes with dummy python executables python.exe and python3.exe that take you to the microsoft store to install it- after which it is a real python executable instead of a dummy one. If you run where python, you'll get a list of all the python executables that are found via the PATH variable in the order that they are found in the PATH, where one of them will be the Windows one (instead of the one you installed from the Python website). Likely, the one you'll see listed first will be C:\Users\you\AppDate\Local\Microsoft\WindowsApps\python.exe.

What you probably need to do is update the order of entries in your PATH environment variable so that the directory containing the one you installed from the Python website is earlier in the PATH environment variable than the directory of the out-of-box Windows one.

Note: As indicated in this question: why must python executable path be added to system PATH environment variables for python command to work in visual studio code, you might need to add the directory containing your from-website Python to the system PATH environment variable (before/above the path to the directory of the system one) (as opposed to the user PATH environment variable).

Or, you may be able to remove those dummy executables in your Windows "App Executable Alias" settings (as shown in this answer).

starball
  • 20,030
  • 7
  • 43
  • 238