0

I can't open .py files in IDLE by double-clicking them in Finder (IDLE is currently set as the default program for opening such files). Nor can I open those files by right-clicking and selecting IDLE.

If IDLE is already open I can open .py files through the File > Open method. Once IDLE is open I can also just double-click .py files and they will open in IDLE. Finally, in the Terminal, I can open .py files just fine by typing idle -e file.py even if IDLE has not yet been opened.

I just can't open IDLE itself by double-clicking on .py files, or by right-clicking on .py files and selecting IDLE.

I'm using OSX 10.8.2 and Python/IDLE 2.7.3. Anyone know how I can fix this?

  • env PATH=/usr/bin:/bin:/usr/sbin:/sbin idle file.py works for me, I can't check your version since I have not installed Tkinter for my Python3.3 I use. Have you installed other python than default? – Eir Nym Mar 9 '13 at 22:51
  • @EirNym, I had Python 2.7.3 and Python 2.6 (from python.org) installed on my machine, and then I uninstalled both and re-installed OSX and XCode. Then I reinstalled Python 2.7.3 (again from python.org). In which file are you setting the path in your comment? – GChorn Mar 12 '13 at 2:41
  • As IDLE is a GUI it won't look at any change in your path in .profile files - does the Apple IDLE work? – Mark Mar 13 '13 at 16:07
1
  1. You don't need to install python 2.7.3 on ML since it's default.
  2. If you really need custom installation of python (if you need special site packages for example), you need to install it from mac ports or from home brew (I do prefer mac ports). And rule custom packages from that location.
  3. To make IDLE runnable from your python installation you have to resolve all dependencies such as TKinter.
  • I'm really confused. When I installed ML, the default version of Python I got (when I typed "python" at the command line) was 2.7.2, not 2.7.3. Also I wasn't aware that IDLE came pre-installed on ML. Based on your answer, I'm no longer sure how to tell the ML pre-installed Python/IDLE versions from the python.org ones. – GChorn Mar 21 '13 at 9:30
  • You can freely to remove python from python.org and install from MacPorts if you need different python to setup site packages – Eir Nym Mar 21 '13 at 19:40
0

You can right-click on a python file and select get info. Near the bottom of the get info window is a section that reads Open With. You can select a version of Idle to use. There is a button below that reads change all. If you click this, then all files with .py extension will be opened with idle. Just tested this and it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .