I am having trouble with my python installation. i have installed python at C:\Users\stand\AppData\Local\Programs\Python\Python311\. I have an environmental variable path there and to C:\Users\stand\AppData\Local\Programs\Python\Python311\Scripts\ But if I am cmd prompt python --version ge me:
"Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases." if I am in C:\users\stand or an subdirectory OTHER than \Python311. I just don't understand.
Look at this
Thread under fixing Path if needed.
So you add as in
image to Path:
C:\Users\stand\AppData\Local\Programs\Python\Python311\
C:\Users\stand\AppData\Local\Programs\Python\Python311\Scripts\
If you use
py --version
it will magically woks.
Not all know that
py.exe
get installed to windows folder when install Python(since Python 3.3).
py can be used on all Python version installed.
G:\div_code
λ py --version
Python 3.11.0
G:\div_code
λ py --list
-V:3.11 * Python 3.11 (64-bit)
-V:3.10 Python 3.10 (64-bit)
-V:3.9 Python 3.9 (64-bit)
-V:3.8 Python 3.8 (64-bit)
-V:3.7-32 Python 3.7 (32-bit)
-V:3.6-32 Python 3.6 (32-bit)
-V:3.5-32
-V:3.4
-V:2.7
-V:2.1
-V:ContinuumAnalytics/Anaconda39-64 Anaconda py39_4.9.2
-V:ContinuumAnalytics/Anaconda37-64 Anaconda 4.7.12
-V:ContinuumAnalytics/Anaconda36-32 Anaconda 4.3.14
If i do
python --version
(now will use Path) it will point to python 3.10 as that what's i have set in Os Path.
G:\div_code
λ python --version
Python 3.10.5
So running old Python 2.1 with
py
would be like this.
G:\div_code
λ py -2.1
Python 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> print 'hello world'
hello world