Skip to content

Commit

Permalink
fix for python 3.8 from microsoft store failing to add new venv (micr…
Browse files Browse the repository at this point in the history
…osoft#6086)

* fix for python 3.8 from microsoft store failing to add new venv

new versions of python >= 3.8 from the windows store have a different executable name (ie. python3.8.exe) in the registry InstallPath, compared to what is in the venv folder (python.exe) so search for both if interpExe is not found.

Fix microsoft#6082

* minor refactor
  • Loading branch information
bschnurr committed Apr 10, 2020
1 parent 46dddbb commit f3c82bb
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -405,8 +405,11 @@ IInterpreterRegistryService service
interpExe = Path.GetFileName(baseInterpreter.Configuration.InterpreterPath);
winterpExe = Path.GetFileName(baseInterpreter.Configuration.GetWindowsInterpreterPath());
var scripts = new[] { "Scripts", "bin" };
interpExe = PathUtils.FindFile(prefixPath, interpExe, firstCheck: scripts);
winterpExe = PathUtils.FindFile(prefixPath, winterpExe, firstCheck: scripts);

// new versions of python >= 3.8 from the windows store have a different executable name (ie. python3.8.exe) in the
// registry InstallPath, compared to what is in the venv folder (python.exe) so search for both if interpExe is not found.
interpExe = PathUtils.FindFile(prefixPath, interpExe, firstCheck: scripts) ?? PathUtils.FindFile(prefixPath, "python.exe", firstCheck: scripts);
winterpExe = PathUtils.FindFile(prefixPath, winterpExe, firstCheck: scripts) ?? PathUtils.FindFile(prefixPath, "pythonw.exe", firstCheck: scripts);
pathVar = baseInterpreter.Configuration.PathEnvironmentVariable;
}

Expand Down

0 comments on commit f3c82bb

Please sign in to comment.