7

For running Python 2, all I do is activate the required Conda environment and just type idle. It automatically opens IDLE for Python 2.7.

But I can't figure out how to do this for Python 3. I have Python 3.5 installed in my environment. I used conda create -n py35 anaconda for installing Python 3.5.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Yashu Seth
  • 935
  • 4
  • 9
  • 24
  • at least in windows, I found the idle command not good enough for me, so I make a direct access to classic idle with this destination: `C:\Anaconda3\pythonw.exe "C:\Anaconda3\Lib\idlelib\idle.pyw"`. Maybe something similar may work for you – Copperfield Jan 19 '16 at 17:03

4 Answers4

11

For how to open IDLE from a Conda virtualenv, the process that works for me is:

activate myenv
python -m idlelib

This should open up the IDLE editor and you can run code within myenv.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
la_leche
  • 423
  • 1
  • 7
  • 14
6

Type idle3 instead of idle from your Conda environment.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
JoelG
  • 129
  • 2
  • 4
  • 4
    That didn't work for me. Idle for python 3 is simply called idle.exe in the /scripts directory now. – chrisfs Jan 22 '18 at 07:33
  • @chrisfs: [The same](https://stackoverflow.com/questions/11856802/start-idle-with-python-3-on-linux-python-2-7-installed-alongside/14132374#comment133279196_14132374) for some versions of some Linux distributions: `idle`, not `idle3`, for launching IDLE 3. Using idle3 results in *"Command 'idle3' not found"* – Peter Mortensen Feb 23 '23 at 08:45
5

To install another version of Python (e.g., Python 3.5.2), when using Anaconda for one version of Python (e.g., Python 2.7), you can do the following on the Anaconda prompt:

First, create a new Conda environment and install Python 3.5.2 with anaconda:

conda create -n py352 python=3.5.2 anaconda

Once complete, if you want to access IDLE of Python 3.5.2 quickly on Windows:

  • Go to the "C:\..Anaconda\envs\py352" folder in Explorer

  • Create a shortcut for pythonw.exe file located on that folder.

  • Move the shortcut to your Desktop or any other location easily accessible

  • Right-click the shortcut, go to Properties, and change the target field in the Shortcut tab from

    C:\....\Anaconda\envs\py352\pythonw.exe
    

    to

    C:\...\Anaconda\envs\py352\pythonw.exe "C:\...\Anaconda\envs\py352\Lib\idlelib\idle.pyw"
    
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
nikpod
  • 1,238
  • 14
  • 22
  • For me this does start idle but it doesn't have the right path for all the DLLs that are installed into that Anaconda Env. So some imports fail. – strubbly Oct 28 '18 at 16:10
0

The other answer for creating a shortcut did not work for me, but I was able to get this to work:

  • Create your Conda environment if you haven't already. I'll call mine my_env.
  • Navigate to the C:\...\Anaconda\envs\my_env\Lib\idlelib\ directory
  • Create a shortcut for idle.bat
  • Move the shortcut to another location, rename it, and pin it as desired.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Leland Hepworth
  • 876
  • 9
  • 16