0
I have placed a script test.py
in my %USERPROFILE%
folder:
import sys
print("TEST", sys.version_info, sys.executable)
When running cmd
(WIN+R) and then typing test
+ENTER the following is returned:
C:\Users\wittrup>test
('TEST', sys.version_info(major=2, minor=7, micro=10, releaselevel='final', serial=0), 'C:\\Python27\\python.exe')
I would like this to run with python 3.6.
There are two python versions installed:
C:\Python27\python.exe
C:\Users\wittrup\AppData\Local\Continuum\Anaconda3
echo %path:;=&echo.%
shows:
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\pythonxy\SciTE-3.5.1-4
C:\Program Files (x86)\pythonxy\console
C:\Users\wittrup\AppData\Local\Microsoft\WindowsApps
C:\Users\wittrup\AppData\Local\Continuum\Anaconda3
C:\Users\wittrup\AppData\Local\Continuum\Anaconda3\Scripts
(and a bunch of other stuff I deemed irrelevant for this case)
C:\Users\wittrup>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
Registry:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe
C:\Users\wittrup\AppData\Local\Continuum\Anaconda3\python.exe
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\python.exe
C:\Users\wittrup\AppData\Local\Continuum\Anaconda3\python.exe
What beats me here, is I really cannot figure out how Windows ends up running the script with python 2.6 - any other places to look?
C:\Users\wittrup>ver
Microsoft Windows [Version 10.0.17134.407]
1Add to the post the output of
assoc .py
andftype | findstr py
. – harrymc – 2018-12-08T13:06:36.293