Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run IDLE for python 3 in a conda environment?

For running python2 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 install installing python 3.5 .

like image 320
Yashu Seth Avatar asked Jan 19 '16 15:01

Yashu Seth


2 Answers

Just in case others searched for how to open IDLE from a conda virtualenv and found this answer, 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.

like image 138
la_leche Avatar answered Oct 07 '22 22:10

la_leche


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 "C:\..Anaconda\envs\py352" folder on 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"
    
like image 5
nikpod Avatar answered Oct 07 '22 23:10

nikpod