Difference between revisions of "PyWrapper"

From mx Help Wiki
Jump to: navigation, search
m
m (Notes on getting pyWrapper to link to mx)
 
(6 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
=== for OS X (10.3.9) ===
 
=== for OS X (10.3.9) ===
  
Steps 1 and 2 went off without a hitch after I installed the latest version of [http://pythonmac.org/packages/py24-fat/index.html Python] (2.4).
+
While its not very clear from the initial installation notes on the pyWrapper site I think you can just do part A and it will attempt to install all the necessary components. If not do the following from B:
  
There may be some problems with the default versions of libxml and the xslt libraries.  To update libxml2 and libxslt try looking here for hints:
+
* Steps 1 and 2 went off without a hitch after I installed the latest version of [http://pythonmac.org/packages/py24-fat/index.html Python] (2.4).
  
http://jamesclarke.info/notes/libxml2
+
* Step 3 (lxml)
  
Some of the links at http://xmlsoft.org/XSLT/downloads.html -> downloads don't have the latest version of libxml2 OR libxslt.  I eventually found them here (using 2.6.9):
+
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:
  
ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/
+
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 autoconf' or 'sudo port install gperf').
  
Used xslt 1.1.9. (failed)
+
After doing all this (do update both autoconf and gperf on a fresh install of 10.3.9) you can install lxml with this:
  
 +
sudo easy_install lxml
  
 +
This fixes the paths etc. too.
  
I followed James' instructions with this difference in the flag for both libxml2 and libxslt ./configure commands (this vs. the updated version of Python):
+
OR, if you don't want to use 'sudo easy_install lxml' you can:
  
./configure --with-python=/Library/Frameworks/Python.framework/Versions/2.4/
+
Now, download and unpack [http://cheeseshop.python.org/pypi/lxml| lxml], and run
  
The other flags need to be included.
+
python setup.py build
  
'''lxml'''
+
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).
still dying, the current error is:
+
  
In file included from src/lxml/etree.c:27:
+
=== Post installation notes ===
/usr/local/include/libxml2/libxml/xmlstring.h:29: error: redefinition of `xmlChar'
+
<much more barfing>
+
  
I'm using
+
==== Connection tab ====
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
+
Use the settings in the database.yml file of mx.
xsltproc --version
+
 
 +
Sweeet ... more soon.

Latest revision as of 00:13, 16 March 2007

Contents

[edit] Notes on getting pyWrapper to link to mx

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

[edit] for OS X (10.3.9)

While its not very clear from the initial installation notes on the pyWrapper site I think you can just do part A and it will attempt to install all the necessary components. If not do the following from B:

  • 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 autoconf' or 'sudo port install gperf').

After doing all this (do update both autoconf and gperf on a fresh install of 10.3.9) you can install lxml with this:

sudo easy_install lxml

This fixes the paths etc. too.

OR, if you don't want to use 'sudo easy_install lxml' you can:

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).

[edit] Post installation notes

[edit] Connection tab

Use the settings in the database.yml file of mx.

Sweeet ... more soon.

Personal tools