Difference between revisions of "PyWrapper"

From mx Help Wiki
Jump to: navigation, search
Line 11: Line 11:
 
* Step 3 (lxml)  
 
* Step 3 (lxml)  
  
There are two dependencies, libxml2 and libxslt. Using MacPorts to install these is probably a good idea. Install MacPorts following [http://trac.macosforge.org/projects/macports/wiki/InstallingMacPorts]. Now:
+
There are two dependencies, libxml2 and libxslt. Using MacPorts to install these is probably a good idea. Install MacPorts following [http://trac.macosforge.org/projects/macports/wiki/InstallingMacPorts this]. Now:
 +
 
 
  sudo port selfupdate
 
  sudo port selfupdate
 
  sudo port install libxml2
 
  sudo port install libxml2
 
  sudo port install libxslt
 
  sudo port install libxslt
 
  sudo port install py-setuptools
 
  sudo port install py-setuptools
 +
 
XCode for 10.3.9 has old build tools, so if you encounter any build-related errors during this process, you may be able to get things working by using 'port' to install newer versions of the build tool in question (e.g. 'sudo port install gperf').
 
XCode for 10.3.9 has old build tools, so if you encounter any build-related errors during this process, you may be able to get things working by using 'port' to install newer versions of the build tool in question (e.g. 'sudo port install gperf').
  
Now,  
+
Now, download and unpack lxml, and run
 
+
 
+
 
+
 
+
 
+
 
+
'''lxml'''
+
still dying, the current error is:
+
 
+
In file included from src/lxml/etree.c:27:
+
/usr/local/include/libxml2/libxml/xmlstring.h:29: error: redefinition of `xmlChar'
+
<much more barfing>
+
  
I'm using
+
  python setup.py build
  python setup.py build_ext -i -I /usr/local/include/libxml2
+
  
Once libxml and libxslt are install try this to see what version is running
+
or 'make' in that directory. You will need to make sure the contents of the 'lxml-X.X.X/src' directory is in your PYTHONPATH, either by moving them or adding the directory to the path (I'm not a python person, so I don't know what the proper way to manage Python libraries is).
xsltproc --version
+

Revision as of 15:11, 12 March 2007

Notes on getting pyWrapper to link to mx

The installation guide is here: http://trac.pywrapper.org/pywrapper/wiki/InstallationGuide

for OS X (10.3.9)

Following the steps from the pywrapper install guide.

  • Steps 1 and 2 went off without a hitch after I installed the latest version of Python (2.4).
  • Step 3 (lxml)

There are two dependencies, libxml2 and libxslt. Using MacPorts to install these is probably a good idea. Install MacPorts following this. Now:

sudo port selfupdate
sudo port install libxml2
sudo port install libxslt
sudo port install py-setuptools

XCode for 10.3.9 has old build tools, so if you encounter any build-related errors during this process, you may be able to get things working by using 'port' to install newer versions of the build tool in question (e.g. 'sudo port install gperf').

Now, download and unpack lxml, and run

python setup.py build

or 'make' in that directory. You will need to make sure the contents of the 'lxml-X.X.X/src' directory is in your PYTHONPATH, either by moving them or adding the directory to the path (I'm not a python person, so I don't know what the proper way to manage Python libraries is).

Personal tools