FYI: Windows PIL-1.1.7 causes WinSxS errors

286 views
Skip to first unread message

Dan Halbert

unread,
Apr 26, 2011, 11:32:08 AM4/26/11
to pyins...@googlegroups.com
I had a WinSxS issue with the PIL (Python Imaging Library) PIL-1.1.7 Windows installer, and at first I thought it was a PyInstaller issue. Since PIL is a commonly-used library, some of you might also encounter this. So I will mention this issue for here posterity, as it took a while to debug.

My executable generated by PyInstaller generated this error when run, on Windows 7:
"The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail."

It turns out that the PIL-1.1.7 Windows installers (from effbot.org) for at least Python 2.6 and 2.7 incorrectly contain a manifest that references a Windows debug library. Specifically, _imagingft.pyd contains this:

<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>

That's wrong: it should only have release-version VC90 libraries. I don't have the Debug libraries installed; I don't know if you wouldn't see this problem if you did have them installed.

The workarounds are to build PIL yourself, revert to PIL-1.1.6, or edit the .pyd file with a binary file editor and comment out the bad dependency (e.g., replace it with spaces or turn the tags into XML comment tags).

This was reported to and acknowledged by the PIL author about a year ago, but he has not yet fixed the installers. See https://bitbucket.org/effbot/pil-117/issue/1/windows-build-of-_imagingft-module-fails
Google for << _imagingft.pyd DebugCRT >> for other commentary.

I used sxstrace.exe to debug this, but it doesn't narrow down the problem to a specific manifest: it reports a VC90.DebugCRT issue. I had to grep through all the libraries PyInstaller gathered up to find the problem one.

Dan

Florian Höch

unread,
Apr 26, 2011, 12:21:08 PM4/26/11
to pyins...@googlegroups.com
Hi Dan,

thanks for posting your findings. While this is definitely a problem
that should be fixed in PIL as you mentioned, I'm wondering if I should
add some code to PyInstaller that automatically "fixes" embedded
manifests which reference assemblies that are not actually used by
removing those references. Don't know if that'd be worthwile though, as
it currently only affects PIL afaik.

--
Florian Höch

Reply all
Reply to author
Forward
0 new messages