I have 2 Python versions installed on my PC: 3.7 and 2.7
Only python 3.7 path defined in Windows PATH
variable.
When I run a script from command line using python
command:
python my_script.py
It works. BUT, when I run this script without typing python
command, I get an error:
Traceback (most recent call last):
File "C:\.......my_script.py", line 3, in <module>
from tkinter import *
ImportError: No module named tkinter
I installed tkinter
only for python 3, so I assume it tried to run my_script.py
using python 2
How can I define in Windows to run python scripts using version 3 instead of 2 without typing command python
?
(adding any sort of #!...python3
in the beginning of the script did not helped)
Thank you for your help