--People who started running Python in PowerShell and were skipped to the Microsoft Store --People who run Python scripts in PowerShell and nothing happens --People who have already set the path and could originally execute Python
~~ The cause is unknown, but it seems that the following path is referenced. Let's change the order of environment variables. It seems that the cause is Windows 10 May 2019 Update (Thanks to @Miyukiumoo) https://forest.watch.impress.co.jp/docs/serial/yajiuma/1188376.html
The root of all evil
C:\Users\user\AppData\Local\Microsoft\WindowsApps\python.exe
When I tried to run a Python script in PowerShell as usual, nothing happened and the process returned. Not even at the command prompt. When I started the interpreter as a trial, it was skipped to the Microsoft Store.
** Why? ?? ** **
By the way, at this time, I was able to execute the script normally in the virtual environment of Anaconda.
When I tried to update conda the day before, it took a lot of time and it was displayed as a messed up conflict. I used Ctrl-c to interrupt / restart, and I wonder if the default environment was broken. Anaconda I tried to put it back in, but it didn't work.
It should have been confirmed before reinserting Anaconda. .. ..
Check environment variables. The path goes to python.exe properly.
** Then why? ?? ** **
I finally noticed here. I wonder why it jumped to the Microsoft Store instead of an error in the first place. If you check the path referenced by the command
> where python
C:\Users\user\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\user\Anaconda3\python.exe
** Something **
When I checked it with Explorer, it looked like a relatively recent file. I tried to delete it with anger, but it was also played.
I wondered if it could be erased if I executed it with administrator privileges, but I chose a way to solve it comfortably.
When you run the command, it scans the path of environment variables and executes the first file found. Make sure that Anaconda3's python.exe is found before the python.exe that is sent to the Microsoft Store.
You can now run Python safely.
If you cannot execute a command, first check the path referenced by the command.
It was a situation that made me want to say that my computer broke even though I hadn't done anything. Didn't you do this for later study? If so, please let me know.