INSTALL.txt 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. Installing lxml
  2. ===============
  3. Requirements
  4. ------------
  5. You need Python 2.3 or later.
  6. You need libxml2 and libxslt, in particular:
  7. * libxml 2.6.21 or later. It can be found here:
  8. http://xmlsoft.org/downloads.html
  9. If you want to use XPath, do not use libxml2 2.6.27. We recommend
  10. libxml2 2.7.2 or later.
  11. * libxslt 1.1.15 or later. It can be found here:
  12. http://xmlsoft.org/XSLT/downloads.html
  13. Newer versions generally contain less bugs and are therefore
  14. recommended. XML Schema support is also still worked on in libxml2,
  15. so newer versions will give you better complience with the W3C spec.
  16. Installation
  17. ------------
  18. If you have easy_install_, you can run the following as super-user (or
  19. administrator)::
  20. easy_install lxml
  21. .. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall
  22. This has been reported to work on Linux, MacOS-X 10.4 and Windows, as long as
  23. libxml2 and libxslt are properly installed (including development packages,
  24. i.e. header files, etc.).
  25. Building lxml from sources
  26. --------------------------
  27. If you want to build lxml from SVN you should read `how to build lxml
  28. from source`_ (or the file ``doc/build.txt`` in the source tree).
  29. Building from Subversion sources or from modified distribution sources
  30. requires Cython_ to translate the lxml sources into C code. The
  31. source distribution ships with pre-generated C source files, so you do
  32. not need Cython installed to build from release sources.
  33. .. _Cython: http://www.cython.org
  34. .. _`how to build lxml from source`: build.html
  35. If you have read these instructions and still cannot manage to install lxml,
  36. you can check the archives of the `mailing list`_ to see if your problem is
  37. known or otherwise send a mail to the list.
  38. .. _`mailing list`: http://codespeak.net/mailman/listinfo/lxml-dev
  39. MS Windows
  40. ----------
  41. For MS Windows, the `binary egg distribution of lxml`_ is statically
  42. built against the libraries, i.e. it already includes them. There is
  43. no need to install the external libraries if you use an official lxml
  44. build from PyPI.
  45. If you want to upgrade the libraries and/or compile lxml from sources, you
  46. should install a `binary distribution`_ of libxml2 and libxslt. You need both
  47. libxml2 and libxslt, as well as iconv and zlib.
  48. .. _`binary distribution`: http://www.zlatkovic.com/libxml.en.html
  49. .. _`binary egg distribution of lxml`: http://cheeseshop.python.org/pypi/lxml
  50. MacOS-X
  51. -------
  52. The system libraries of libxml2 and libxslt installed under MacOS-X
  53. tend to be rather outdated. In any case, they are older than the
  54. required versions for lxml 2.x, so you will have a hard time getting
  55. lxml to work without installing newer libraries.
  56. A number of users reported success with updated libraries (e.g. using
  57. fink_ or macports), but needed to set the runtime environment variable
  58. ``DYLD_LIBRARY_PATH`` to the directory where fink keeps the libraries.
  59. See the `FAQ entry on MacOS-X`_ for more information.
  60. .. _fink: http://finkproject.org/
  61. .. _`FAQ entry on MacOS-X`: FAQ.html#my-application-crashes-on-macos-x
  62. A macport of lxml is available. Try ``port install py25-lxml``.