Windows: subprocess won't run different Python interpreter

Thorsten Kampe thorsten at thorstenkampe.de
Fri Nov 11 01:01:42 EST 2016


* eryk sun (Thu, 10 Nov 2016 23:04:02 +0000)
> 
> On Thu, Nov 10, 2016 at 9:58 PM, Thorsten Kampe
> <thorsten at thorstenkampe.de> wrote:
> >
> > I'm trying to run a script with a different Python version by
> > extending the path variable and executing "python.exe". It looks like
> > subprocess will always run the current executing Python.
> 
> WinAPI CreateProcess checks the application directory, current
> directory (an insecure legacy default), %SystemRoot%\System32,
> %SystemRoot%\System, %SystemRoot%, and then the directories in %PATH%.
> This is listed in the documentation of the lpCommandLine parameter on
> MSDN [1].

I'm aware of that. Python is in F:\PortableApps\Python3x and neither 
the current directory nor the PATH points to that.

Thorsten




More information about the Python-list mailing list