I just installed Python 3.8.5 with the executable from the Python website (I am using Windows). Then, when running python3 example.py, which uses tkinter, it returns
Traceback (most recent call last):
File "example.py", line 3, in <module>
import tkinter
ModuleNotFoundError: No module named 'tkinter'
When I run python3 --version in Command Prompt, though, it outputs Python 3.8.0b1. Also, when I type something invalid after python or python3, like python foo, it outputs C:\Users\User\Downloads\depot_tools\bootstrap-3_8_0b1_chromium_1_bin\python\bin\python.exe: can't open file 'foo': [Errno 2] No such file or directory. I assume all this must be happening because it is using the Python install from the Chromium depot_tools, which I must have installed at some point.
I have removed C:\Users\User\Downloads\depot_tools from both the User and System environment variables and added C:\Users\User\AppData\Local\Programs\Python\Python38-32\ to both, to no success. Deleting the depot_tools folder also doesn't work, outputting nothing when running python or python3. I know there is nothing wrong with the Python 3.8.5 install because running C:\Users\User\AppData\Local\Programs\Python\Python38-32\python.exe example.py runs the program as intended.
How do I change the environment variables to make running python or python3 use my Python 3.8.5 install?
pycommand will pick by setting the environment variablePY_PYTHONto the version you want.