Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start IDLE with python 3 on Linux (python 2.7 installed alongside)

I initially had python 2.7, which often comes bundled with the OS (currently using Linux Mint 12). I wanted to try python 3, so I installed it alongside python 2. All fine there, I can run both versions in terminal by calling either python or python3. However, there seems to be no way to start IDLE with python 3. Is there some flag that I can pass to IDLE when I start it so that I can pick which version of python I would like it to run?

E.g. (these don't work) idle3 or idle --shell=python3 or something like that. Hope you get what I mean. I read about pointing to a different executable in this question about IDLE for Python 3 (on Vista). However, I can't seem to do the analogous thing on Linux.

like image 854
Samuel Tan Avatar asked Aug 08 '12 02:08

Samuel Tan


4 Answers

You'd have to install the appropriate package - Python 2.x and 3.x aren't compatible with each other.

You can find the link here.

like image 57
Makoto Avatar answered Oct 24 '22 03:10

Makoto


Just type sudo apt-get install idle3 in your terminal and idle for your version of Python 3 previously installed will be installed. Then both are compatible. You run the 2.7 idle from your terminal by just typing idle. And you run the idle 3 version by just typing idle3 in the terminal. That worked for me.

like image 36
user1944489 Avatar answered Oct 24 '22 02:10

user1944489


I had to install python3-tools to get idle3 (using Fedora 18).

like image 28
Christy Avatar answered Oct 24 '22 03:10

Christy


I installed idle using the following command:

sudo yum install python-tools.x86_64

And I can run both the command and gives me python2 or 3 shell respectively:

idle
idle3
like image 33
iiiir.com Avatar answered Oct 24 '22 03:10

iiiir.com