[Osgeo4w-trac] [osgeo4w] #385: Cannot use libxml2

OSGeo4W trac_osgeo4w at osgeo.org
Fri Oct 18 09:10:11 PDT 2013


#385: Cannot use libxml2
-------------------+--------------------------------------------------------
Reporter:  GG1234  |       Owner:  osgeo4w-dev@…              
    Type:  defect  |      Status:  new                        
Priority:  minor   |   Component:  Package                    
 Version:          |    Keywords:                             
-------------------+--------------------------------------------------------

Old description:

> Hello all,
>
> Trying to use libxml2 in some python code, I run into this error message
> :
> ImportError: No module named libxml2
>
> I thought it was in my PATH settings, but it seems to have all it needs
> (see below).
>
> Any hints ?
>
> Thanks a lot,
>
> GG.
>
> SET GDAL_DATA=C:\OSGeo4W\share\epsg_csv
> SET GISBASE=C:\OSGeo4W\apps\grass\grass-6.4.3
> SET GISRC=C:\DATA\GRASS
> SET GRASS_SH=C:\OSGeo4W\apps\msys\bin\sh.exe
> SET LD_LIBRARY_PATH=C:\OSGeo4W\apps\grass\grass-6.4.3\lib
> SET
> Path=C:\OSGeo4W\bin;C:\OSGeo4W\lib;C:\OSGeo4W\apps\python27\Scripts;C:\OSGeo4W\apps\python27\lib
> \site-
> packages\PyQt4;C:\OSGeo4W\apps\qgis;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\grass-6.4.3\scripts;C:\OSGeo4W\apps\grass\grass-6.4.3\etc;C:\OSGeo4W\apps\grass\grass-6.4.3\etc\python;C:\OSGeo4W\apps\grass\grass-6.4.3\lib;C:\OSGeo4W\apps\grass\grass-6.4.3\bin;C:\OSGeo4W\apps\msys\bin;%PATH%
> SET PYTHONHOME=C:\OSGeo4W\apps\python27
> SET PYTHONLIB=C:\OSGeo4W\apps\python27;
> SET
> PYTHONPATH=C:\OSGeo4W\apps\qgis\python\Lib;C:\OSGeo4W\apps\qgis\python;C:\OSGeo4W\bin;C:\OSGeo4W\apps\grass\grass-6.4.3\etc\python
> SET QGIS_DEBUG=1
> chcp 65001
> SET GDAL_DATA=C:\OSGeo4W\share\gdal
> SET GDAL_DRIVER_PATH=C:\OSGeo4W\bin\gdalplugins\

New description:

 Hello all,

 Trying to use libxml2 in some python code, I run into this error message :
 ImportError: No module named libxml2

 I thought it was in my PATH settings, but it seems to have all it needs
 (see below).

 Any hints ?

 Thanks a lot,

 GG.
 {{{
 SET GDAL_DATA=C:\OSGeo4W\share\epsg_csv
 SET GISBASE=C:\OSGeo4W\apps\grass\grass-6.4.3
 SET GISRC=C:\DATA\GRASS
 SET GRASS_SH=C:\OSGeo4W\apps\msys\bin\sh.exe
 SET LD_LIBRARY_PATH=C:\OSGeo4W\apps\grass\grass-6.4.3\lib
 SET PYTHONHOME=C:\OSGeo4W\apps\python27
 SET PYTHONLIB=C:\OSGeo4W\apps\python27;
 SET QGIS_DEBUG=1
 chcp 65001
 SET GDAL_DATA=C:\OSGeo4W\share\gdal
 SET GDAL_DRIVER_PATH=C:\OSGeo4W\bin\gdalplugins\
 }}}

 ''[editor's note: forced line-wrap for legibility]''
 {{{
 SET Path=C:\OSGeo4W\bin;^
 C:\OSGeo4W\lib;^
 C:\OSGeo4W\apps\python27\Scripts;^
 C:\OSGeo4W\apps\python27\lib\site-packages\PyQt4;^
 C:\OSGeo4W\apps\qgis;^
 C:\OSGeo4W\apps\qgis\bin;^
 C:\OSGeo4W\apps\grass\grass-6.4.3\scripts;^
 C:\OSGeo4W\apps\grass\grass-6.4.3\etc;^
 C:\OSGeo4W\apps\grass\grass-6.4.3\etc\python;^
 C:\OSGeo4W\apps\grass\grass-6.4.3\lib;^
 C:\OSGeo4W\apps\grass\grass-6.4.3\bin;^
 C:\OSGeo4W\apps\msys\bin;%PATH%

 SET PYTHONPATH=C:\OSGeo4W\apps\qgis\python\Lib;^
 C:\OSGeo4W\apps\qgis\python;^
 C:\OSGeo4W\bin;C:\OSGeo4W\apps\grass\grass-6.4.3\etc\python
 }}}

--

Comment(by maphew):

 Sorry, the libxml2 package installed with osgeo4w isn't a python package.

 There is an old ticket, #226, which indicates there might be possible
 collisions with installing python `lxml` in addition to the binary
 `libxml2` package we have now, but so far as I know no one has tested to
 see if that's true.

 I did try installing python lxml via pip ([wiki:ExternalPythonPackages],
 `pip install lxml`) but that failed with ''"make sure the development
 packages of libxml2 and libxslt are installed"''. This means it's trying
 to build from source instead of grabbing the binary version.

 Going direct to the latest egg binary for 2.7 with `pip install
 %url_to_egg%` also failed, but this time for a lcoal reason, ''"IOError:
 [Errno 2] No such file or directory: 'd:\\temp\\systmp\\pip-
 el8cr5-build\\setup.py'"''

 The next thing to try would be using a standard Windows Installer, see
 #114. I've run out of time to dig into this personally.


 Sources:

  * http://stackoverflow.com/questions/1904752/install-libxml2-and-
 associated-python-bindings-windows
  * latest 2.7 egg I could find:
 https://pypi.python.org/packages/2.7/l/lxml/lxml-2.3-py2.7-win32.egg#md5=607f701d0961834667abe737b3206215

-- 
Ticket URL: <http://trac.osgeo.org/osgeo4w/ticket/385#comment:1>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the Osgeo4w-trac mailing list