Installing PyAMF 0.4.0rc1 on Windows XP
I wanted to give the latest pyamf a go, but when I used the standard 'setup.py install', the following ominous warning was presented:
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
Uh oh! I actually DO have Cygwin installed, but unfortunately this message is a default and not entirely helpful. It did put me on the right path to actually getting it to go.
This webpage has a lot of good information on the subject, and it is where I pulled out these steps:
1. Grab the MingW32 Automated Installer and get it installed. I selected all of the available options as I figured it wouldn't hurt (it didn't)
2. Add the mingw32 binaries to your system path environmental variable (ie c:\mingw32\bin)
3. Tell Python to use mingw32 when it needs to compile a distribution by adding a file called distutils.cfg in this folder: {PYTHON_INSTALL}\lib\distutils\distutils.cfg. The file should contain:
[build]
compiler = mingw32
4. Version number parsing was throwing errors, so you actually have to edit {PYTHON_INSTALL}\lib\distutils\version.py to get it compiled. At line 100 make the following change:
from:
1 2 | version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$', re.VERBOSE) |
to:
1 2 | version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? (\. (\d+))?$', re.VERBOSE) |
now with all that done, just run 'setup.py install' and it should compile as expected. Easy as... I dunno, it is actually kind of confusing, but it works and now I can give pyamf a whirl with the c-ext enabled.

The Installing PyAMF 0.4.0rc1 on Windows XP by Joel Hooks, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 3.0 United States License.
-
Joel Hooks
-
Nick Joyce















