8

I went to this page and downloaded the tar file : http://pypi.python.org/pypi/lxml/2.3.4#downloads

I then copied the lxml folder to my Python26/Lib folder. Now, when i go to the interpreter and type from lxml import etree i get the error: cannot import etree. Does someone know what is going wrong? I am running windows.

rypel
  • 4,686
  • 2
  • 25
  • 36
Programmer
  • 6,565
  • 25
  • 78
  • 125

2 Answers2

3

Better follow the installation instructions; lxml has some C components that require compilation.

I am guessing that you are on Windows, in which case the binary egg should work. On PyPI, the most recent version to include binary eggs for Windows is 2.3, but you can find more recent (unofficial) installers elsewhere.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
3

Simply unzipping the archive and moving it is not how one should install Python packages. You usually run python setup.py install from the folder; but on Windows there are easier ways.

Go to this link download and the installer for the version of Python you are using.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284