The Wayback Machine - https://web.archive.org/web/20130607093651/http://code.google.com/p/spyderlib/wiki/PatchingDistutils
My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
PatchingDistutils  
Instructions for patching distutils
Updated May 11, 2013 by pierre.r...@gmail.com

Introduction

Spyder for Windows is generally distributed through an executable binary installer created using Python's distutils package. Unfortuantely, distutils has a bug. In a nutshell, the Windows binary installer fails to carry out the actions specified in the post-installation script during an uninstall. The solution to Spyder  Issue 971  necessitated the creation of Windows registry entries that need to be removed during the uninstall. To make sure the Spyder uninstall happens cleanly, distutils must be patched on the system where the installers will be built as described below.

Applying the Patch

To build a binary Windows installer, Python 2.7 distutils includes a couple of small Windows executables that get packaged into the final installer. Those are stored below the distutils sub-directory of the main Python install location. On a typical Windows install, the directory of interest is

C:\Python27\Lib\distutils\command

On Linux, the directory of interest is

/usr/lib/python2.7/distutils/command

In that directory there could be several Windows executables, but the two of interest here are

  • wininst-9.0.exe
  • wininst-9.0-amd64.exe

The first is for 32-bit installers, and the second is for 64-bit installers. To repair the distutils bug mentioned above, these executables need to be replaced with patched versions which are available for download here:

After download, these files need to be renamed and copied into the directory noted above, replacing the existing wininst-9.0 files. Make a backup of the originals beforehand if you want to be able to roll back the patch.

Finally you have to use the following command to build the installer:

python setup.py build bdist_wininst
Powered by Google Project Hosting