Create an IDLE shortcut for the ArcGIS Python you want

4787
3
08-07-2019 08:36 PM
curtvprice
MVP Esteemed Contributor
2 3 4,787

IDLE is easy and fast and is always there with Python distributions. It isn't fancy, but it does get the job done. Old Unix hands will nod in agreement when it is praised as "the vi of Python IDEs".

The default installed Python shortcut in your start menu IDLE (Python GUI) opens one of the ArcGIS Pythons you have available (ArcMap 2.7 x32 or x64). As there can be as many as three (those two plus ArcGIS Pro's main Conda Python environment), you may want to test Python code using others.  

Here is how to do create desktop shortcuts to open IDLE with these other ArcGIS Python installations. These instructions assume you have both ArcMap and Pro installed.

Step 1. Create a shortcut on the desktop for IDLE

  1. Do a Windows search for IDLE  (type IDLE in the search box)
  2. Right click IDLE (Python GUI). This is the default shortcut installed with ArcMap. Select "Open File Location"
  3. The folder that opens contains the ArcMap Python shortcuts.

Step 2. Create an IDLE shortcut for ArcGIS Pro's Python environment

  1. Open the file explorer and navigate to: <Install Folder>\bin\Python\envs\arcgispro-py3\Lib\idlelib

  2. Right click the file idle.bat Send to > Desktop (create shortcut) 

  3. On the desktop find idle.bat - shortcut right click > Rename to a more useful name like IDLE Pro
  4. If you want open the shortcut's properties and assign an icon to make it easy to identify. I imported the icon from the file <Install Folder>\bin\Python\envs\arcgispro-py3\Lib\idlelib\icons\idle.ico

Step 3. Create an IDLE shortcut for ArcMap's x32 Python environment (optional)

If you have ArcMap x64 background geoprocessing installed, the IDLE (Python GUI) start menu item uses its Python (Python 2.7 x64) n. However, you may want to create an IDLE shortcut to access the Python 2.7 x32 that corresponds to ArcMap's native 32-bit Python environment ("foreground"). (If you don't have the x64 background processing installed, the default shortcut IDLE (Python  GUI) will already open Python 2.7 x32.)  You would want this shortcut to run scripts that only run in x32 geoprocessing, for example scripts that use the metadata GP tools or read personal (.mdb) geodatabases.

  1. On the desktop, copy and paste IDLE (Python GUI), this will create  IDLE (Python GUI) - Copy

  2. Rename IDLE (Python GUI) - Copy to IDLE ArcMap32

  3. Right click IDLE ArcMap32> Properties

  4. Modify Target string to remove x64 from the path:
    from: C:\Python27\ArcGISx6410.6\pythonw.exe "C:\Python27\ArcGISx6410.6\Lib\idlelib\idle.pyw"
    to: C:\Python27\ArcGIS10.6\pythonw.exe "C:\Python27\ArcGIS10.6\Lib\idlelib\idle.pyw"

References

Writing Python scripts—Help | ArcGIS Desktop 

Background Geoprocessing (64-bit)—Help | ArcGIS Desktop 

Python in ArcGIS Pro—ArcPy Get Started | ArcGIS Desktop 

Localized and silent install options—ArcGIS Pro | ArcGIS Desktop  (INSTALLDIR)

3 Comments
About the Author
PhD candidate (Geology), South Dakota Mines; Hydrologist, U.S. Geological Survey.
Labels