pythonwindowspippathsystem

System can't find python.exe even though it's added to path


I was using python fine last night, but this morning, any python command I try to run gives me this error

The system cannot find the file C:\Users\nickr\AppData\Local\Microsoft\WindowsApps\python.exe.

Even if I do this in a virtual environment, it gives me this error

Unable to create process using '"C:\Users\nickr\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" C:/Users/nickr/Documents/assistApp/main.py'

I've set my path variable to the directory given in the error and still nothing, I've tried installing windows build tools and I've restarted my console. I even tried deleting and reinstalling python, and I made it set a path variable and it still doesn't work.


Solution

  • I figured out the problem, the directory that the error gave was also in my path variables and so windows was constantly looking there, so I just deleted that path in my path variables so it didn't look there anymore and all of my python scripts are working