How can I run IDLE for Python 3 in a Conda environment?
Asked Answered
V

4

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.

Variable answered 19/1, 2016 at 15:49 Comment(1)
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 youHymnology
S
12

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.

Stonge answered 9/9, 2019 at 22:10 Comment(0)
B
6

Type idle3 instead of idle from your Conda environment.

Brianna answered 27/12, 2017 at 5:27 Comment(2)
That didn't work for me. Idle for python 3 is simply called idle.exe in the /scripts directory now.Jurgen
@chrisfs: The same for some versions of some Linux distributions: idle, not idle3, for launching IDLE 3. Using idle3 results in "Command 'idle3' not found"Radii
R
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"
    
Resnatron answered 9/8, 2017 at 4:31 Comment(1)
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.Cumber
S
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.
Serrulate answered 20/9, 2022 at 16:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.