Change default python version in IDLE
9,533
If you need Python 2 just type idle
in terminal.
If you need Python3 type idle3
.
I have both Python2 and Python3 installed and also idle and idle3.
Related videos on Youtube
Author by
Stefano De Rosso
Updated on September 18, 2022Comments
-
Stefano De Rosso almost 2 years
So, I'd like to have Python 2.7.6 when I open the IDLE (that is the one pre-installed on Ubuntu); instead, the idle opens with the one that I have installed (2.7.5). How can I do that?
-
Nodak over 9 years@StefanoDeRosso, you still have Python 2.7.6 installed, right?
-
Stefano De Rosso over 9 yearsI have Python 2.7.6 installed, and when I run it from the terminal it is the default one. I've changed it to the default using the "ln" command. Anyway, I've came through the problem - even though in an "alternative" way -, by uninstalling and reinstalling the IDLE in Ubuntu Software Center. In any case I'd like to resolve it the other way, too.
-
Nodak over 9 yearsbut when you execute
/usr/bin/idle-python2.7
, modified or not, from the command line the idle is 2.7.5? -
Stefano De Rosso over 9 yearshey hey, executing "/usr/bin/idle-python2.7", it works! It opens the IDLE for Python 2.7.6. But is there some way to make it happen only writing "idle" on the terminal?
-
Nodak over 9 yearsSure, the instructions are in
/usr/lib/python2.7/idlelib
prepend the parent of this idlelib dir to sys.path. Otherwise, importing idlelib gets the version installed with the Python used to call this module:`...or un-install 2.7.5 -
Stefano De Rosso over 9 yearsUgh, I don't know how, but it seems that there is no "idlelib" directory in Python 2.7.6; there is, instead, this directory in Python 2.7.5
-
Stefano De Rosso over 9 yearsI don't know, maybe it means something that I have installed the 2.7.6 IDLE from the Software Center and not from the Terminal? Because its directory is "usr/bin/idle-python2.7"
-
Nodak over 9 years
idlelib
is in2.7.5
because that was the version of Python into which it was installed. If you want to call up Idle from the terminal with justidle
you must either remove it from 2.7.5, or remove 2.7.5 from your system. It can't be in both. It wouldn't know which way to go. But since you've essentially scabbed on 2.7.6 with a symbolic link either option is not as simple as it sounds.