Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
qgib opened this issue Nov 3, 2014 · 12 comments
Closed

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

qgib opened this issue Nov 3, 2014 · 12 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! PyQGIS Related to the PyQGIS API
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Nov 3, 2014

Author Name: SC SC (SC SC)
Original Redmine Issue: 11536
Affected QGIS version: 2.6.0
Redmine category:pyqgis_console


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 issue(s): #20509 (duplicates)
Redmine related issue(s): 12331


@qgib
Copy link
Contributor Author

qgib commented Nov 5, 2014

Author Name: Patrick Maslen Maslen (Patrick Maslen Maslen)


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

@qgib
Copy link
Contributor Author

qgib commented Nov 6, 2014

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Nov 6, 2014

Author Name: SC SC (SC SC)


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

@qgib
Copy link
Contributor Author

qgib commented Nov 6, 2014

Author Name: Patrick Maslen Maslen (Patrick Maslen Maslen)


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

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2014

Author Name: SC SC (SC SC)


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

@qgib
Copy link
Contributor Author

qgib commented Jan 10, 2015

Author Name: Jürgen Fischer (@jef-n)


this is not a qgis, but a packaging problem.


  • resolution was changed from to invalid
  • status_id was changed from Feedback to Closed

@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2015

Author Name: SC SC (SC SC)


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

@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2015

Author Name: Jürgen Fischer (@jef-n)


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

@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2015

Author Name: SC SC (SC SC)


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?

@qgib
Copy link
Contributor Author

qgib commented Mar 8, 2015

Author Name: Jürgen Fischer (@jef-n)


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.

@qgib
Copy link
Contributor Author

qgib commented Mar 9, 2015

Author Name: SC SC (SC SC)


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?

@qgib
Copy link
Contributor Author

qgib commented Mar 9, 2015

Author Name: Jürgen Fischer (@jef-n)


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.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! PyQGIS Related to the PyQGIS API labels May 25, 2019
@qgib qgib added this to the Version 2.6 milestone May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! PyQGIS Related to the PyQGIS API
Projects
None yet
Development

No branches or pull requests

1 participant