{"id":1053,"date":"2009-10-31T11:54:22","date_gmt":"2009-10-31T01:54:22","guid":{"rendered":"http:\/\/www.somethinkodd.com\/oddthinking\/?p=1053"},"modified":"2011-04-26T03:48:50","modified_gmt":"2011-04-25T17:48:50","slug":"windows-installer-for-pyxml-0-8-4-for-python-2-6-x","status":"publish","type":"post","link":"https:\/\/www.somethinkodd.com\/oddthinking\/2009\/10\/31\/windows-installer-for-pyxml-0-8-4-for-python-2-6-x\/","title":{"rendered":"Windows Installer for PyXML 0.8.4 for Python 2.6.x and Python 2.7.x"},"content":{"rendered":"<h3>Short version<\/h3>\n<p>What you&#8217;ve been searching for:<\/p>\n<p><a href=\"http:\/\/somethinkodd.com\/PyXML\/PyXML-0.8.4.win32-py2.6.exe\">PyXML 0.8.4 for Python 2.6, Windows Installer<\/a> (1,006 KB)<\/p>\n<p><a href=\"http:\/\/somethinkodd.com\/PyXML\/PyXML-0.8.4.win32-py2.7.exe\">PyXML 0.8.4 for Python 2.7, Windows Installer<\/a> (1,012 KB)<\/p>\n<h3>Rambling Version<\/h3>\n<p>So you are a Windows user and you want to install <a href=\"http:\/\/sourceforge.net\/projects\/pyxml\/\">Python\/XML (A.K.A. PyXML)<\/a>, but there is no version on <a href=\"http:\/\/sourceforge.net\/projects\/pyxml\/\">Sourceforge<\/a> since November 2004, when Python 2.4 was all the rage. It isn&#8217;t being maintained any more.<\/p>\n<p>So you turn to your Python friends, and they say &#8220;Oh don&#8217;t use that. There are much better XML libraries now.&#8221; And you say &#8220;But the library I want to use uses <a href=\"http:\/\/pywebsvcs.sourceforge.net\/\">ZSI<\/a> which uses PyXML, and ZSI isn&#8217;t being maintained either.&#8221;<\/p>\n<p>And your Python friends say &#8220;ZSI? Are you using SOAP? 2001 just called and they want their over-hyped protocol stack back.&#8221; And you say &#8220;Yeah, but I need to access a server that only provides SOAP, and someone has written a wrapper layer to it which, surprise, surprise, is no longer being maintained. Besides, the whole &#8216;the past called&#8217; gag is a bit dated too, isn&#8217;t it?&#8221;<\/p>\n<p>So they say &#8220;Ah, just install it with <a href=\"http:\/\/pypi.python.org\/pypi\/setuptools\">easy_install<\/a>&#8221; and you look at them funny, because you are a Windows programmer, and they are Linux programmers, and that&#8217;s not the way you do things around here.<\/p>\n<p>Either you decide to give it a go, or you decide to download the source directly and run &#8216;setup.py build&#8217;, and either way it complains about &#8216;vcvarsall.bat&#8217; being missing, which is its way of saying &#8220;How am I supposed to compile this C code? Don&#8217;t you have Microsoft Visual Studio installed?&#8221; to which you say &#8220;No, I am a Python programmer now! The eighties called, and asked for their C compiler back, and I gave it to them.&#8221; but it isn&#8217;t listening to you, and neither are your Linux friends, because they don&#8217;t want to associate with someone who doesn&#8217;t have a C compiler built in to the operating system.<\/p>\n<div class=\"aside\">Maybe you discover at this point that you can actually run a lot of ZSI <em>without<\/em> the C parts of PyXML. You can just install the non-C parts. This worked for me for almost a month, but eventually it came across some XML that needed the C code and it fell over.<\/div>\n<p>Then you hear a rumour about a free Visual Studio command-line compiler, and a free C compiler called gcc or <a href=\"http:\/\/www.mingw.org\/\">MINGW<\/a> or something. Sounds too hard, so you yell in frustration &#8220;All I want is a nice Windows installer with pre-built binaries? Hasn&#8217;t anyone on the internet built one for me?&#8221; and your Linux friends who were pretending they couldn&#8217;t hear you finally turn around and say &#8220;Wait, you are going to run a binary you just found somewhere on the net? Are you crazy? It could have all sorts of nasty code in there.&#8221; and you just look at them funny because that&#8217;s just the way you do things around here.<\/p>\n<p>If this is you, I have a solution! I have built the PyXML distribution, ready to just install, linked at the top and bottom of this post. If you don&#8217;t trust me (and frankly, you shouldn&#8217;t), I have provided instructions on how to do it yourself.<\/p>\n<h4>Building It Yourself<\/h4>\n<p>(Much credit to psems&#8217;s instructions in this <a href=\"http:\/\/old.nabble.com\/Installing-PyXML-problems-td12405796.html\">post.<\/a>)<\/p>\n<p>First, download <a href=\"http:\/\/sourceforge.net\/projects\/pyxml\/files\/pyxml\/0.8.4\/PyXML-0.8.4.tar.gz\/download\">PyXML 0.8.4 source<\/a>. Extract it (with your favourite archive tool; I use <a href=\"http:\/\/www.7-zip.org\/\">7zip<\/a>) and extracted into a temp directory.<\/p>\n<p>Now, follow these instructions heavily cribbed from <a href=\"http:\/\/old.nabble.com\/Installing-PyXML-problems-td12405796.html\">this post<\/a>:<\/p>\n<blockquote><p>\n1. Visit the <a href=\"http:\/\/sourceforge.net\/project\/showfiles.php?group_id=2435\">MINGW<\/a> sourceforge page: <\/p>\n<p>2. Download &#038; Run: Automated MinGW Installer (make sure you check the base, g++ and Make)<\/p>\n<p>3. &lt;Snipped&gt;<\/p>\n<p>4. Create (or edit): C:\\Python26\\Lib\\distutils\\distutils.cfg and add the following 2 lines: <\/p>\n<p><code>[build]<br \/>\ncompiler=mingw32<\/code>\n<\/p><\/blockquote>\n<div class=\"aside\">Step 3 said to &#8220;Update your PATH: Add the C:\\mingw\\bin directory to the system PATH&#8221;. I was once bitten by <a href=\"http:\/\/www.cygwin.com\/\">Cygwin<\/a> in <em>1998<\/em>, which totally broke a whole lot Windows scripts by inserting itself in my path. Cygwin and MINGW have similar goals, and I am still superstitious about this, even though I should get over it. I added MINGW to my path temporarily, see below.<\/div>\n<p>Okay, now go the command line, and get yourself into the temp directory.<\/p>\n<p>Add MINGW to your path temporarily by typing <code>PATH=%PATH%;c:\\mingw\\bin\\<\/code><\/p>\n<p>If Python 2.6.x isn&#8217;t already your path, do a similar command like: <code>PATH=%PATH%;c:\\Python26<\/code>, or just type c:\\python26\\python in front of every command below.<\/p>\n<p>(Or similarly for Python 2.7.x)<\/p>\n<p>If you just want to install it, type:<\/p>\n<p><code>setup.py build<\/code><br \/>\n<code>setup.py install<\/code><\/p>\n<p>This time there should be lots of output but no errors.<\/p>\n<p>If you want to do what I did, and create a distributable installer type:<\/p>\n<p><code>setup.py bdist_wininst<\/code><br \/>\n<code>setup.py bdist<\/code><\/p>\n<p>The first one contains an exe, which is what you wanted. The second one creates a zip, which some people prefer. You will find them in the dist subdirectory.<\/p>\n<p>Once you have the exe, you know how to install it &#8211; good ol&#8217; double-click! How embarrassing for the Linux people that they have to <em>type<\/em> &#8220;easy_install&#8221;, which means it is already far too hard for us Windows folks!<\/p>\n<p>Check it worked by typing starting python and typing <code>import xml.dom.ext.reader<\/code>; it shouldn&#8217;t give an error.<\/p>\n<h3>The Results<\/h3>\n<p><a href=\"http:\/\/somethinkodd.com\/PyXML\/PyXML-0.8.4.win32-py2.6.exe\">PyXML 0.8.4 for Python 2.6, Windows Installer<\/a> (1,006 KB)<\/p>\n<p><a href=\"http:\/\/somethinkodd.com\/PyXML\/PyXML-0.8.4.win32.zip\">PyXML 0.8.4 for Python 2.6, ZIP archive<\/a> (1,310 KB)<\/p>\n<p><a href=\"http:\/\/somethinkodd.com\/PyXML\/PyXML-0.8.4.win32-py2.7.exe\">PyXML 0.8.4 for Python 2.7, Windows Installer<\/a> (1,012 KB)<\/p>\n<p><a href=\"http:\/\/somethinkodd.com\/PyXML\/PyXML-0.8.4.win32.zip\">PyXML 0.8.4 for Python 2.7, ZIP archive<\/a> (1,316 KB)<\/p>\n<h3>Licence<\/h3>\n<p>It should be obvious, but I am not claiming any ownership of this code. Nor am I offering any warranties. It should be used subject to the copyright notices and licences included, which give credit to the people who actually contributed to the project.<\/p>\n<p>All of the original code is available from <a href=\"http:\/\/sourceforge.net\/projects\/pyxml\/\">Sourceforge<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the modern Windows Python programmer, stuck with old libraries:<\/p>\n<p><a href=\"http:\/\/somethinkodd.com\/PyXML\/PyXML-0.8.4.win32-py2.6.exe\">PyXML 0.8.4 for Python 2.6, Windows Installer<\/a> (1,006 KB)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","footnotes":""},"categories":[34],"tags":[81,335],"class_list":["post-1053","post","type-post","status-publish","format-standard","hentry","category-software-development","tag-python","tag-pyxml"],"_links":{"self":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/comments?post=1053"}],"version-history":[{"count":15,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1053\/revisions"}],"predecessor-version":[{"id":1537,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1053\/revisions\/1537"}],"wp:attachment":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/media?parent=1053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/categories?post=1053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/tags?post=1053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}