Changing Python IDLE Windows shell association to 32 bit version

When both 32 bit python and 64 bit python are installed in the same machine, the order of installation will decide the default association for python files. Both 32 bit and 64 bit versions of python will be installed when installing ArcGIS Desktop and ArcGIS Server (respectively) are installed in the same machine. If Server is installed after installing desktop, the default version of python will be 64 bit which results in the failure of many geoprocessing scripts written for desktop.

The following steps will help you get back the association to 32 bit version of python:

Open regedit (windows button+r, then type regedit and hit enter) and go to :

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Python.File\shell\Edit with IDLE\command

and change the default value to:

"C:\Python27\ArcGIS10.3\pythonw.exe" "C:\Python27\ArcGIS10.3\Lib\idlelib\idle.pyw" -e "%1"

(or wherever your 32 bit installation path is)

Additional Note on Setting up the Python Environment

To find file association of python file, the following steps will help:

  1. Run assoc.py from commandline to find the association file name

    eg: c: >assoc.py

    which gives Python.File as result

  2. Run ftype on the result

    eg: c: >ftype Python.File

    which gives the active path to Python

  3. Now you can add Python file location to System Path via control panel or system settings. The command line way of setting path is as follows :

set PATH=%PATH%;C:\Python26\ArcGIS10.0\; C:\Python26\ArcGIS10.0\Scripts

Explanation:

set PATH=%PATH%;  > takes the current path and sets PATH to it.

C:\Python26\ArcGIS10.0\; C:\Python26\ArcGIS10.0\Scripts     > Adds this directory to the path, because of 'set PATH' this is added to the path