Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install python3 + lxml on windows

I would like to install python3 with lxml on windows 7. There seems to be several versions available. What's the best version/way to install?

  • By best I mostly mean the easiest.
  • Points if I don't have to compile anything.
like image 625
pguardiario Avatar asked Oct 27 '11 01:10

pguardiario


People also ask

How do I import lxml into Python?

Open your Linux terminal or shell. Type “ pip install lxml ” (without quotes), hit Enter. If it doesn't work, try "pip3 install lxml" or “ python -m pip install lxml “. Wait for the installation to terminate successfully.

Are lxml libxml2 and libxslt installed?

Unless you are using a static binary distribution (e.g. from a Windows binary installer), lxml requires libxml2 and libxslt to be installed, in particular: libxml2 version 2.9. 2 or later.

How do I know if lxml is installed?

To check which version of lxml is installed, use pip show lxml or pip3 show lxml in your CMD/Powershell (Windows), or terminal (macOS/Linux/Ubuntu) to obtain the output major.


2 Answers

I had the same problem locating the correct version. After several hours of confusion I finally found the windows binary for Python 3 at Christoph Gohlke's Unofficial Windows Binaries for Python Extension Packages website at UC, Irvine.

He truly has the A-Z of Python extensions, as long as it's available for Python. Anything one could want from the PIP installer to Chinese word segmentation, to a multi-taper Fourier spectral estimator. Beyond that it gets into biologic & scientific specialty extensions.

like image 132
Deina Underhill Avatar answered Oct 17 '22 20:10

Deina Underhill


Use the current stable version of 3, 3.2.2. You can find a windows installer here http://python.org/ftp/python/3.2.2/python-3.2.2.msi that will install python for you.

Use the Python Package Index version of lxml: it has a windows installer specifically for Python 3.

http://pypi.python.org/packages/3.1/l/lxml/lxml-2.2.8.win32-py3.1.exe#md5=d1fb73a8596bb77e155cef7ae6b0bc53

Download and run the Python installer then download and run the lxml installer: it should be that easy.

like image 37
bakennedy Avatar answered Oct 17 '22 18:10

bakennedy