Python Forum

Full Version: MAC Python IDLE issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, whenever I have IDLE open, I can right click a python script in finder and open with IDLE. However, when IDLE is not already open, I get an error message saying “The document could not be opened.IDLE cannot open files in the python script format”. I have already checked system preferences/ privacy settings for Python’s access to documents, and it looks fine. I have seen similar issues online but I am yet to find a solution that works.
The solution (in my opinion) is to stop using IDLE.
I know it's included with the python distribution, but the fact is that it's just not a very robust IDE.

There are many freely available IDE's just google 'python IDE'.
I use VSCode and am quite happy with it.
PyCharm is another great IDE, and has a community edition.
(Oct-27-2021, 10:51 PM)Larz60+ Wrote: [ -> ]The solution (in my opinion) is to stop using IDLE.
I know it's included with the python distribution, but the fact is that it's just not a very robust IDE.

There are many freely available IDE's just google 'python IDE'.
I use VSCode and am quite happy with it.
PyCharm is another great IDE, and has a community edition.


Thanks for that, I will follow your advice. I recently switched from Windows to Mac and this is one of the things I found inconvenient. On Windows, I could just go to file explorer, right click >"Edit with idle" and it would be as simple as that. Also, you can't make new documents by right clicking in finder, as you can in file explorer. I feel like switching back to Windows, but I have read a lot of advice online recommending Mac for programming.
I suggest to rethink your workflow. In programming it is customary to use terminal/shell.

Under Monterey I had no trouble opening .py files in using Open with > IDLE in Finder irrespective whether IDLE was already open or not. So it's probably about settings.
Unfortunately, I have already checked System Preferences> Privacy settings and I can see Python is granted access to documents. Other posts online suggested this could be an OS issue; I tried upgrading to Monterey but the issue is still present.

I believe this entry from https://bugs.python.org/issue38946 summarises my issue best:

Now just to make things a bit more complicated - sigh: I also tested with the recent python.org installer for the 3.10.0a4 pre-release. The principal difference between the 3.9.1 and 3.10.0a4 versions I tested with is that the 3.9.1 is linked with Tk 8.6.10 while 3.10.0a4 is linked with the just-released Tk 8.6.11. On macOS 11 Big Sur, there is one noticeable difference in behavior between the two. With the macOS 11 Big Sur / 3.10.0a4 / 8.6.11 combo, when double-clicking on a .py file without IDLE.app being active, a message window appears saying that the application cannot open Python Script files but does launch IDLE.app. With IDLE.app now active, double-clicking again on the same file then does cause the file to be opened in an edit window of the active IDLE as expected and double-clicking on other .py files then open edit windows for them as expected. Without more detailed investigation, this appears to be a minor problem (possibly a change in Tk) unrelated to those in this issue other than that it involves double-clicking on .py files but I thought I should mention it here in case someone runs into it before it is resolved.