Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MAC Python IDLE issue
#1
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.
Reply
#2
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.
Reply
#3
(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.
Reply
#4
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.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#5
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why can I not see the code correctly in Python IDLE.? Trump 8 653 Apr-04-2024, 07:47 AM
Last Post: jonesphedra
  Launch Python IDLE Shell from terminal Pavel_47 5 1,212 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Python Idle won't start totalmachine 9 3,483 Oct-16-2022, 05:57 PM
Last Post: totalmachine
  Why is IDLE not opening on a MacOS Montery 12.6 and using Python 3.10.7? Merlin385 7 1,668 Oct-08-2022, 08:36 PM
Last Post: Merlin385
  Python MYSQL connection does not work after 1h idle zazas321 9 6,743 Oct-07-2021, 12:02 PM
Last Post: ndc85430
  Customize Python Keywords for IDLE alanvers 0 1,993 Apr-03-2021, 10:56 AM
Last Post: alanvers
  Comparison Operator "is" idle vs python command spisatus 3 2,771 Oct-29-2019, 10:00 PM
Last Post: DeaD_EyE
  python script file not opening in IDLE editor srm 2 4,378 Jun-23-2019, 08:45 AM
Last Post: Larz60+
  Python 3.6.5 syntax error in IDLE loren41 7 5,068 May-11-2019, 02:52 PM
Last Post: loren41
  uising python zero with IDLE I get an error of 'module not found' Brian123 1 3,886 Apr-24-2019, 09:21 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020