简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM