EOX-A / QgsWcsClient2

A QGis WCS2.0/EO-WCS Plugin
Other
3 stars 2 forks source link

Python unfulfilled dependencies QGIS 2.8.1 #5

Closed nmtoken closed 9 years ago

nmtoken commented 9 years ago

When trying to install the plugin I get an error message:

The plugin is broken, Python said: No module named lxml

I'm on a a 64 Bit windows version of QGIS, other system details below:

QGIS version | 2.8.1-Wien | QGIS code revision | exported
Compiled against Qt | 4.8.5 | Running against Qt | 4.8.5
Compiled against GDAL/OGR | 1.11.2 | Running against GDAL/OGR | 1.11.2
Compiled against GEOS | 3.4.2-CAPI-1.8.2 | Running against GEOS | 3.4.2-CAPI-1.8.2 r3921
PostgreSQL Client Version | 9.2.4 | SpatiaLite Version | 4.1.1
QWT Version | 5.2.3 | PROJ.4 Version | 480
QScintilla2 | Version   2.7.2 |  | 
eox-cs1 commented 9 years ago

Hey, ,
the plugin requires (as a prerequisite) that the python package lxml (somtimes called python-lxml) is installed (as described in the Readme).
Have a look at: https://pypi.python.org/pypi/lxml/3.3.5#downloads or check out the lxml home page: http://lxml.de/installation.html#installation

nmtoken commented 9 years ago

I was trying to install from within QGIS and there is no read me on the plugin info page; perhaps you could add the dependency notice there, that would be helpful :)

eox-cs1 commented 9 years ago

Hey,

When using the QGIS-Plugin installer, and when selecting the QgsWcsClient2, there is a description of the QgsWcsClient2 plugin on the right hand side of the window. Just above the Stars it states:
"Requirements: This tool currently requires the python lxml-module to be pre-installed."

nmtoken commented 9 years ago

oops sorry, :} I was looking at the blurb for version 0.1 and now I see in version 0.2 in QGIS you give the information.

My problem now is that after updating to Python 2.7.9 to get pip automatically, I was having real problems trying to get 64 bit pip on windows, and after installing lxml, and IDLE confirming to me me that I have 3.4.4 (thanks to http://stackoverflow.com/questions/20611504/find-python-lxml-version), I now get an error loading the plugin which helpfully tells me:

The plugin is broken, Python said: No module named lxml

Any thoughts?

eox-cs1 commented 9 years ago

Hmm, sorry, not really. I'm not that familiar with the windows installation routines.
The error message sounds a little bit like a path problem. Maybe have a look at the %PATH& or %PYTHONPATH% settings (these are used on Linux to look for certain stuff). But this is just a rough guess. You may also compare the location of the Python used by QGIS fits with the location of the installed lxml. And maybe also check at the QGIS site if you can find some info for windows there. I would guess that something similar might have happened to someone before. Sorry for not having more valuable help on this. Just one more thing - could you please post the solution here, once you succeeded. Thanks

nmtoken commented 9 years ago

Unfortunately, I haven't yet got the answer but I do now have a different error message.

First off the principal difference between a Window vs Linux/Mac install is that the Windows QGIS, as I understand it, bundles its own version of Python.

So my QGIS python is: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] and my system python is now: Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)]

So when I used pip to install lxml, it was with my system python, and it got installed into the system python location, that is to:

C:\Python27\Lib\site-packages\lxml

I tried initially to install the lxml file into the QGIS python installation directly with the appropriate .msi installer from https://pypi.python.org/pypi/lxml/3.4.4, but the installation wizard couldn't be modified to see it (it only had eyes for the system python).

Then I tried to add this system python packages path to the QGIS site.py file as per this GIS.SE posting:

http://gis.stackexchange.com/questions/55342/qgis-plugins-with-python-dependencies.

I also tried to just copy the lxml folder to the site-packages folder within the QGIS python installation, which for me:

C:\OSGeo4W64\apps\Python27\Lib\site-packages

In both cases I got an error:

DLL load failed: The specified module could not be found

If I choose to keep the plugin installed, I get the following fuller error when restarting QGIS:

Couldn't load plugin QgsWcsClient2 due to an error when calling its classFactory() method

Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 219, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/jpass/.qgis2/python/plugins\QgsWcsClient2\__init__.py", line 42, in classFactory
    from qgswcsclient2 import QgsWcsClient2
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/jpass/.qgis2/python/plugins\QgsWcsClient2\qgswcsclient2.py", line 46, in 
    from qgswcsclient2dialog import QgsWcsClient2Dialog
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/jpass/.qgis2/python/plugins\QgsWcsClient2\qgswcsclient2dialog.py", line 43, in 
    from lxml import etree
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: The specified module could not be found.
nmtoken commented 9 years ago

The issue lxml: DLL load failed: The specified module could not be found is quite a common error reported on windows systems unfortunately, for example:

http://stackoverflow.com/questions/7228229/lxml-dll-load-failed-the-specified-module-could-not-be-found

The solution for me has been to install an unofficial lxml build from Unofficial Windows Binaries for Python Extension Packages

Which installs in my system python, then modify the sites.py file in QGIS as detailed above.