简体   繁体   English

系统找不到 python.exe,即使它已添加到路径

[英]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我昨晚使用 python 很好,但是今天早上,我尝试运行的任何 python 命令都会给我这个错误

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.我已将路径变量设置为错误中给出的目录,但仍然没有,我尝试安装 windows 构建工具并重新启动控制台。 I even tried deleting and reinstalling python, and I made it set a path variable and it still doesn't work.我什至尝试删除并重新安装 python,我让它设置了一个路径变量,但它仍然不起作用。

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我发现了问题所在,错误给出的目录也在我的路径变量中,所以 windows 一直在寻找那里,所以我只是在我的路径变量中删除了该路径,所以它不再在那里看,我的所有 python 脚本在工作中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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