[QGIS-Developer] DLL load failed with PyDev

Lauri Kajan lauri.kajan at gmail.com
Fri Dec 15 04:03:09 PST 2017


Hi all,
The great news is that I have already solved the problem.
I'm just writing to ask if anybody understands the reason behind this
phenomenon and to give advice for those how must struggle with the same
problem.

I have an eclipse startup bat as instructed in qgis documentation and
still, I got the DLL load failed error when trying to import something from
qgis.core.

The reason for this is the way I defined a jvm for Eclipse in eclipse.ini
(I don't have JRE bundled in eclipse installation).
At the first, I had in my eclipse.ini
-vm
C:\ProgramData\Oracle\Java\javapath
and I got the ImportError
when I changed that to the real JRE path
-vm
C:\Program Files\Java\jre1.8.0_152\bin\javaw.exe
everything work as supposed to.

The javapath folder is a "new" way to define used java version. It has
symlinks (yes, on windows) to the real java installation. This is the
folder that java installation appends to the PATH environment variable.

In both ways, the sys.path is the same.
When eclipse is started with -vm C:\ProgramData\Oracle\Java\javapath
os.environ['PATH'] is:
C:/Program Files/Java/jre1.8.0_152/bin/server;C:/Program
Files/Java/jre1.8.0_152/bin;C:/Program
Files/Java/jre1.8.0_152/lib/amd64;C:\OSGEO4~1\apps\qgis-dev\bin;C:\OSGEO4~1\apps\qt5\bin;C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\apps\Python36\Scripts;C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem;C:\OSGeo4W64;
and when with -vm C:\Program Files\Java\jre1.8.0_152\bin\javaw.exe
the os.environ['PATH'] is:
C:\OSGEO4~1\apps\qgis-dev\bin;C:\OSGEO4~1\apps\qt5\bin;C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\apps\Python36\Scripts;C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem

I don't understand this because of the qgis_core.dll folder
C:\OSGEO4~1\apps\qgis-dev\bin is in the PATH with both ways but it on the
other way it gives an error.

I'm just happy now that I found the solution for this even I don't
understand the reason.


Should we add this to the documentation also?

P.S.
Is there a reason for C:\OSGEO4~1\apps\Python27\Scripts to be still on the
PATH when using py3 environment?


Thanks,

-Lauri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20171215/e7a188d9/attachment.html>


More information about the QGIS-Developer mailing list