Python未找到但可以安装

编程入门 行业动态 更新时间:2024-10-17 09:54:15
本文介绍了Python未找到但可以安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚刚安装了 python3.8 和 sublime 文本编辑器.我正在尝试在 sublime 文本上运行 python 构建,但遇到找不到 Python 但可以安装"错误.

I have just installed python3.8 and sublime text editor. I am attempting to run the python build on sublime text but I am met with "Python was not found but can be installed" error.

python 和 sublime 都安装在 E:\

Both python and sublime are installed on E:\

当打开 cmd 提示符时,我可以更改目录并且能够从那里运行 py 没有问题.

When opening cmd prompt I can change dir and am able to run py from there without an issue.

我假设我的 sublime 没有指向正确的目录,但不知道如何解决这个问题.

I'm assuming that my sublime is not pointing to the correct dir but don't know how to resolve this issue.

推荐答案

这不是 Sublime 问题,而是 Windows 10 问题.我的 Windows 10 盒子没有这个功能,所以我不确定它的传播范围有多广,但你可能想看看这个(看似无关的)问题 权限被拒绝"尝试在 Windows 10 上运行 Python.

This isn't a Sublime issue, it's a Windows 10 issue. My Windows 10 boxes don't have this feature so I'm not sure how widely spread it is, but you may want to check out this (seemingly unrelated) question "Permission Denied" trying to run Python on Windows 10.

这篇文章的一般要点是,这些新的存根重定向器应该引导您从 Windows 应用商店安装一些缺失的应用程序,并且应该优先考虑用户安装的版本,但这取决于 PATH 被修改,系统可能会在您的用户安装版本之前找到存根版本.

The general gist from this post is that these new stub redirectors are supposed to direct you into installing some missing applications from the Windows App store and that user-installed versions are supposed to take priority, but depending on how the PATH is modified the system might find the stub versions before your user installed versions.

目前接受的答案提到:

纠正它的第二部分是键入管理应用程序执行别名";进入 Windows 搜索提示并完全禁用 Python 的商店版本.

The second part of correcting it is to type "manage app execution aliases" into the Windows search prompt and disable the store versions of Python altogether.

您可能只需要执行第二部分,但在我的系统上,我进行了两项更改,现在一切都恢复正常了.

It's possible that you'll only need to do the second part, but on my system I made both changes and everything is back to normal now.

在评论中,有来自 Zooba 的评论进一步表明这是要走的路:

In the comments, there are comments from Zooba which further indicate that this is the way to go:

(这里是微软员工和 CPython 核心开发人员)你肯定只需要做第二部分.有几个与升级应用程序重置别名相关的错误,这些错误将在下一个稳定更新中修复,因此到那时应该是一次性修复.当您收到 Insiders 更新时,您可能需要多做几次.

(Microsoft employee and CPython core developer here) You definitely only need to do the second part. There have been a couple of bugs related to upgrading apps resetting aliases which will be fixed in the next stable update, so it should be a one-time fix by then. While you're getting Insiders updates you may need to do it a couple more times.

... 启动商店是一项帮助人们安装 Python 的新功能 - 如果您使用常规安装程序将其添加到 PATH 中,它应该优先于新的重定向器,但如果没有,您已经在上面发现了如何禁用它.

... And launching the Store is a new feature to help people install Python - if you've added it to PATH using the regular installer it should take precedence over the new redirector, but if not you've discovered above how to disable it.

更多推荐

Python未找到但可以安装

本文发布于:2023-11-28 15:16:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642924.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:未找到   Python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!