You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks for making this software, it's proving to be a life-saver for me right now!
This issue seems similar to #2, although my situation is a little different.
I do have Python 3 installed, but I still get the Microsoft Store redirect when I try to run a python script from powershell. After doing some digging, it seems this was the culprit:
I think we have this problem when installing Python because in a new Windows installation the aliases are in the ON position as in image below. When turned on, Windows puts an empty or fake file named python.exe and python3.exe in the directory named %USERPROFILE%\AppData\Local\Microsoft\WindowsApps. This is the alias.
Then Microsoft put that directory at the top of the list in the "Path" environment variables.
When you enter "python" in cmd, it searches the directories listed in your "Path" environment variables page from top to bottom. So if you installed Python after a new Windows 10 install then get redirected to the Windows Store, it's because there are two python.exe's: The alias in the App Execution Alias page, and the real one wherever you installed Python. But cmd finds the App execution, alias python.exe, first because that directory is at the top of the Path.
Obnoxious of Windows to do this, but it's easy enough to fix once you see what's going on. I don't know if there's an easy programmatic way to handle this in-script, but maybe at least either alert the user to remove their aliases if the script doesn't actually run, or just move to the next fallback? Or even just adding a note in the docs about this potential pitfall.
(Someone suggested a programmatic solution to this issue for use in scripts, though I'm not sure if directly messing with the user's aliases like this is the best idea:)
I wonder if there is an easy way to check if python actually runs that would not open the Microsoft Store in case the alias has higher priority (or Python is not installed)?
First of all thanks for making this software, it's proving to be a life-saver for me right now!
This issue seems similar to #2, although my situation is a little different.
I do have Python 3 installed, but I still get the Microsoft Store redirect when I try to run a python script from powershell. After doing some digging, it seems this was the culprit:
Obnoxious of Windows to do this, but it's easy enough to fix once you see what's going on. I don't know if there's an easy programmatic way to handle this in-script, but maybe at least either alert the user to remove their aliases if the script doesn't actually run, or just move to the next fallback? Or even just adding a note in the docs about this potential pitfall.
(Someone suggested a programmatic solution to this issue for use in scripts, though I'm not sure if directly messing with the user's aliases like this is the best idea:)
The text was updated successfully, but these errors were encountered: