Bug report #11536

lxml module work only with qgis 32bit and not 64bit

Added by SC SC almost 5 years ago. Updated over 4 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:PyQGIS Console
Affected QGIS version:2.6.0 Regression?:No
Operating System:windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:19806

Description

Hi,i download lxml (https://pypi.python.org/pypi/lxml) for my personal python plugins with pypi, but it work only on 32bit version of qgis on windows

for example if in pyQgis console i use

>>> from lxml.etree import fromstring, tostring, Element, _Element
>>>

this work and i can use it too in my plugins

but if i download lxml module on qgis 64bit version on windows

in pyQGIS CONSOLE

from lxml.etree import fromstring, tostring, Element, _Element
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:/PROGRA~1/QGISBR~1/apps/qgis/./python\\qgis\\utils.py", line 460, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: Impossibile trovare il modulo specificato.

instead on OSGeo4W shell of qgis installation both 32bit both 64 bit works

C:\\>python
Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml.etree import fromstring, tostring, Element, _Element
>>>

C:\\>python
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml.etree import fromstring, tostring, Element, _Element
>>>

please solve it


Related issues

Duplicated by QGIS Application - Bug report #12331: plugin load error utils.py line 478 Closed 2015-03-06

History

#1 Updated by Patrick Maslen Maslen almost 5 years ago

I have 32-bit lxml working in 32-bit QGIS 2.6, and 64-bit lxml working in 64-bit QGIS 2.6. If you do not already have 64-bit lxml you will probably need to use a 64-bit browser to download it.

Hope this helps.

Pat

#2 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Open to Feedback

#3 Updated by SC SC almost 5 years ago

Patrick Maslen Maslen wrote:

I have 32-bit lxml working in 32-bit QGIS 2.6, and 64-bit lxml working in 64-bit QGIS 2.6. If you do not already have 64-bit lxml you will probably need to use a 64-bit browser to download it.

Hope this helps.

Pat

i downloaded 64-bit lxml in qgis 64bit , but it not works in pyqgis console, 32bit not problem in qgis 32
if i you see there is the code for to replicate the error

lxml module is very useful for to develop plugins, but this errore stop the use on 64bit windows platform
bye
Salvo

#4 Updated by Patrick Maslen Maslen almost 5 years ago

Hi Salvo

I put the lxml folder in C:\\OSGeo4W64\\apps\\Python27\\Lib\\site-packages and could then use the QGIS Python console to run

from lxml.etree import fromstring, tostring, Element, _Element

Pat

#5 Updated by SC SC almost 5 years ago

Patrick Maslen Maslen wrote:

Hi Salvo

I put the lxml folder in C:\\OSGeo4W64\\apps\\Python27\\Lib\\site-packages and could then use the QGIS Python console to run

from lxml.etree import fromstring, tostring, Element, _Element

Pat

hi Pat

my lxml folder is yet there
in 64 bit installation

C:\\Program Files\\QGIS Brighton\\apps\\Python27\\Lib\\site-packages\\lxml-3.4.0-py2.7-
win-amd64.egg\\lxml>

in 32bit installation

C:\\Program Files (x86)\\QGIS Brighton\\apps\\Python27\\Lib\\site-packages\\lxml-3.4.0-
py2.7-win32.egg\\lxml>

but in 32bit it works, in 64bit NOT (in pyqgis console in qgis )

but in osgeo4w shell if i call python it works both 32bit both 64 bit

i thinked that is some path wrong in pyqgis console but i don't understand where i can change it

#6 Updated by Jürgen Fischer over 4 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

this is not a qgis, but a packaging problem.

#7 Updated by SC SC over 4 years ago

Jürgen Fischer wrote:

this is not a qgis, but a packaging problem.

no, it is not, in osgeo4w it works only in pyqgisconsole and plugin get error

#8 Updated by Jürgen Fischer over 4 years ago

SC SC wrote:

Jürgen Fischer wrote:

this is not a qgis, but a packaging problem.

no, it is not, in osgeo4w it works only in pyqgisconsole and plugin get error

Well, it's not a QGIS problem and it's not a packaging problem - osgeo4w doesn't package lxml.
Try Christoph Gohlke's lxml package from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

#9 Updated by SC SC over 4 years ago

Jürgen Fischer wrote:

SC SC wrote:

Jürgen Fischer wrote:

this is not a qgis, but a packaging problem.

no, it is not, in osgeo4w it works only in pyqgisconsole and plugin get error

Well, it's not a QGIS problem and it's not a packaging problem - osgeo4w doesn't package lxml.
Try Christoph Gohlke's lxml package from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

now is surely qgis problem because 2.8.1 not work too 32 bit version

the same package installed with easy_install lxml works with 2.6.0 32bit , works with osgeo4w 32 and 64bit , but not work in qgis console of 2.8.1

the same error in 478 line of utils.py
i think that in qgis console sometime path go wrong for to load lib, but what?

#10 Updated by Jürgen Fischer over 4 years ago

SC SC wrote:

now is surely qgis problem because 2.8.1 not work too 32 bit version

The lxml binaries apparently need a different version of the msvcr90.dll, but the binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml work.

#11 Updated by SC SC over 4 years ago

Jürgen Fischer wrote:

SC SC wrote:

now is surely qgis problem because 2.8.1 not work too 32 bit version

The lxml binaries apparently need a different version of the msvcr90.dll, but the binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml work.

thank you now it work with 64bit and with 32 bit and 2.8.1

but so is a different use of compiler?

#12 Updated by Jürgen Fischer over 4 years ago

SC SC wrote:

thank you now it work with 64bit and with 32 bit and 2.8.1
but so is a different use of compiler?

QGIS 32bit is now built with VS2010 (before VS2008) - 64bit already used it. So the msvcr90.dll dependency must come from another package.

Also available in: Atom PDF