5

I' ve got an issue with a package I created with Python 3.5.2 32-bit on Windows 7.

I normally deploy my Python packages on Windows by using the bdist_wininst option of setuptools. This way it is very easy for my colleagues to update a package by just starting the windows installer exe. However since I changed to Python 3.5.2 I get the following error when trying to install a package:

Python version -32 required, which was not found in the registry

For me it seems that the installer is looking for a Python version named "-32" which it cannot find. Did someone come across the same problem or find a solution yet?

MrLeeh
  • 5,321
  • 6
  • 33
  • 51
  • Check `findstr /r "target_version=.*" [ExecutableName]`. It should either find nothing or something like `target_version=3.5-32`. – Eryk Sun Nov 10 '16 at 00:48
  • OK, I tried `findstr /r "target_version=.*" mypackage.win32.exe` and I get nothing back. However if I use the option `--target-version="3.5"` for creatin my build-distribution I get `target_version=3.5 `. Then it is also possible for me to install the build distribution. But what is the reason I need to supply the target_version for Python3.5? With earlier versions of Python I didn't have this issue. – MrLeeh Nov 10 '16 at 09:03
  • AFAIK, you shouldn't have to. I wanted to be certain this wasn't a bug in the distutils code that bundles up the executable with the ini file and install script. Based on your result, it seems to be a bug somewhere in the executable, but I didn't see an obvious problem when I scanned over the source. – Eryk Sun Nov 10 '16 at 09:22

2 Answers2

3

It looks like this is a known bug: https://bugs.python.org/issue26630.

The workaround that I discovered is to edit the executable installer manually in a hex-editor. The characters -32 appears in locations 7A5D4-7A5D6. Replace them with all NULL characters. Afterwards, the installer seems to work fine.

Obviously, this is a complete hack. Use at your own risk.

Ed Behn
  • 450
  • 2
  • 10
2

Another workaround I found in 3.6.0 (where bdist_wininst is still broken) was was to use the MSI builder bdist_msi instead.

FYI this is marked as "fixed for 3.5.3, 3.6.1 and default" in https://bugs.python.org/issue26071 (the replacement of https://bugs.python.org/issue26630).

Lawrie
  • 21
  • 3