简体   繁体   English

在 Mac 上打开任何 Python 文件时出现“IDLE 意外退出”

[英]“IDLE quit unexpectedly” when opening any Python file on a Mac

错误信息截图

I was working on my hw for tkinter.我正在为 tkinter 开发我的硬件。 Then it stopped poping up the game it normally does when I hit run.然后它停止弹出游戏,当我点击运行时它通常会出现。 I then decided to restart my computer thinking it would correct itself, but in the end now my apple computer wont even let me open up any python files.然后我决定重新启动我的电脑,以为它会自行纠正,但最后我的苹果电脑甚至不会让我打开任何 python 文件。 It just slowly opens them then closes immediately and gives me the error in the picture.它只是慢慢地打开它们然后立即关闭并给我图片中的错误。 Is there something I can do to fix this?我能做些什么来解决这个问题吗? Thanks!谢谢!

I'm wondering if it is because of Apple.我想知道是不是因为苹果。 If I'm correct the Mac's come with Python 2.7 installed.如果我是正确的,Mac 安装了 Python 2.7。 You downloaded Python 3.8, and now those two versions of Python might be interfering with one another.您下载了 Python 3.8,现在这两个版本的 Python 可能会相互干扰。 Here is a link to using a virtual environment you can install it, and Python 3 in it so it doesn't mix with Python 2 ( https://www.thecrazyprogrammer.com/2018/11/working-with-virtual-environment-for-django-project.html ). Here is a link to using a virtual environment you can install it, and Python 3 in it so it doesn't mix with Python 2 ( https://www.thecrazyprogrammer.com/2018/11/working-with-virtual-environment -for-django-project.html )。 You can ignore the Django commands if you don't want to download Django.如果您不想下载 Django,可以忽略 Django 命令。 I haven't used Mac in awhile so I don't if there is a way you can control PATH variables on Mac's like I can with Windows.我有一段时间没有使用 Mac,所以如果有一种方法可以控制 Mac 上的 PATH 变量,就像我可以使用 Windows 一样,我不会。 You could also download VSCode(free), Atom(free), Sublime(free, but will ask for donation) or any other code editor, and that'll fix your problem too.您还可以下载 VSCode(免费)、Atom(免费)、Sublime(免费,但会要求捐赠)或任何其他代码编辑器,这也可以解决您的问题。

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

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