Installing lxml, libxml2, libxslt for Python 3.5 on Windows 10 -


i first try run basic pip install command it:

c:\program files (x86)\python35-32>pip install lxml collecting lxml   using cached lxml-3.6.4.tar.gz building wheels collected packages: lxml   running setup.py bdist_wheel lxml ... error   complete output command "c:\program files (x86)\python35-32\python.exe" -u -c "import setuptools, tokenize;__file__='c:\\users\\djidiouf\\appdata\\local\\temp\\pip-build-ovqa6ncd\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\djidiouf\appdata\local\temp\tmp9hzx5gztpip-wheel- --python-tag cp35:   building lxml version 3.6.4.   building without cython.   error: b"'xslt-config' not recognized internal or external command,\r\noperable program or batch file.\r\n"   ** make sure development packages of libxml2 , libxslt installed **     c:\users\djidiouf\appdata\local\temp\xmlxpathinitbqgvj3pt.c(1): fatal error c1083: cannot open include file: 'libxml/xpath.h': no such file or directory   *********************************************************************************     not find function xmlcheckversion in library libxml2. libxml2 installed?     *********************************************************************************     error: command 'c:\\program files (x86)\\microsoft visual studio 14.0\\vc\\bin\\cl.exe' failed exit status 2      ---------------------------------------- command ""c:\program files (x86)\python35-32\python.exe" -u -c "import setuptools, tokenize;__file__='c:\\users\\djidiouf\\appdata\\local\\temp\\pip-build-ovqa6ncd\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\djidiouf\appdata\local\temp\pip-kk7fdpzx-record\install-record.txt --single-version-externally-managed --compile" failed error code 1 in c:\users\djidiouf\appdata\local\temp\pip-build-ovqa6ncd\lxml\ 

i tried install libxml2:

c:\program files (x86)\python35-32>pip install libxml2 collecting libxml2   not find version satisfies requirement libxml2 (from versions: ) no matching distribution found libxml2 

and tried install libxslt:

c:\program files (x86)\python35-32>pip install libxslt collecting libxslt   not find version satisfies requirement libxslt (from versions: ) no matching distribution found libxslt 

i tried build lxml sources ( https://github.com/lxml/lxml ) needs libxml2 dependencies well.

i tried install wheel after downloading lxml file http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml :

c:\program files (x86)\python35-32>pip install c:\users\djidiouf\downloads\lxml-3.6.4-cp35-cp35m-win_amd64.whl lxml-3.6.4-cp35-cp35m-win_amd64.whl not supported wheel on platform. 

it seems wheel file doesn't support either windows 10 or python 3.5.

any appreciated.

lxml uses libxml2, libxslt (in background) libxml2, libxslt not python modules - it's c/c++ libraries. can't install them using pip. have download , install them manually.

you can find precompiled lxml windows on unofficial windows binaries python extension packages

  • cp35 in file name means version python 3.5.
  • win32 in file name means version 32bit python.
  • amd64 in file name means version 64bit python.

you use 32bit python because see 32 , (x86) in path

c:\program files (x86)\python35-32\python.exe 

you should find links libxml2, libxslt on page too. libraries has .dll , .exe files , can put them in folder in path variable. libraries installed in c:\windows or in subfolder.

libxml2, libxslt may have c/c++ header files *.h may need when compile lxml. (on linux files in separated packages libxml2-dev, libxslt-dev)


btw: can use anaconda distribution (instead of python.org distribution). installs same python precompiled modules - ie. installs lxml automatically. anaconda can best solution windows users.

list of modules: https://docs.continuum.io/anaconda/pkg-docs


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -