Opening IDLE from Terminal
Asked Answered
E

1

5

I'm new to programming and to be more specific, Python. I was going through the installation process from Robert Sedgewick's Introduction to Programming in Python website until right before the section "Downloading and Installing the Booksite Library". My problem occurred with:

In the Terminal window issue the command idleX.Y (for example, idle2.7). If an IDLE window appears, then you have installed IDLE properly. Close the IDLE window.

As I was installing Python 2.7, I attempted to use the command idle2.7, but I received the following response. As far as I can tell, I followed all of the directions provided by Mr. Sedgewick's website and I have already verified that Python was being installed as version 2.7.10. After looking for answers online, I found a similar one here on Stack Overflow. Unfortunately, the potential solutions listed for that question didn't help resolve my issue. At this point, I should mention that I am trying this on a MacBook Pro (2015 model) running the latest version of OS X (El Capitan).

Thanks for your help!

Electronegative answered 16/2, 2016 at 22:33 Comment(6)
Does this other question address your issue? #8792544Ilka
@Ilka I'm not sure; the instructions from the website state that 'idle2.7' is to be used, not the suggested 'idle' command from your link. When I try 'idle', IDLE pops up, but the Python version listed is 2.7.10, 2.7.11. If it helps, IDLE also says "The version of Tcl/Tk (8.5.9) in use may be unstable".Electronegative
It's in terminal command line, not in Python command line... Not to enter python before you use idle2.7Mccready
@Mccready Yes, I am entering 'idle2.7' in the Terminal. Unfortunately, I didn't understand what you meant by "Not to enter python before you use idle2.7". Could you clarify?Electronegative
@Ilka I apologize; I just learned about python -V and it gave me 2.7.10 as the Python version I installed. Looking around for more clues, I noticed that @Matthewm1970 posted in this Stack Overflow thread that idle2.7 is supposed to work.Electronegative
Sorry I just thought your are enter commands in Python interactive window. The trackback in your pic means that you installed python properly. You may not installed X11.Mccready
B
7

For 2.7, the following, where 'python' is 'whatever string needed to start 2.7' (perhaps 'python', perhaps 'python2'), should work on any OS:

python -m idlelib.idle

For 3.x, .idle can be omitted. In *nix (but not on Windows), python should probably be replaced by python3. The usability of shortcut scripts such as 'idle2.7' depends on the script being both present and on the executable path. That, in turn, depends on the specific installers. In the last year, Python core developers have veered away from the use of a multiplicity of short-cut scripts, which are not dependable, toward python -m module, which is dependable as long as one can start a particular version of Python. On Windows and, I believe on Mac, after using the PSF installers, python can be replaced by py -x or py -x.y if one has multiple python installations.

Bradawl answered 18/2, 2016 at 0:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.