-
-
Notifications
You must be signed in to change notification settings - Fork 448
under windows : load gdal (geo localisation) dll works fine without coverage, with CDLL show a winerror 127 #1222
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
Comments
After some time I was able to reproduce this as well. The interesting thing is that if I were to run this in the could you also try this @esandorfi ? |
Same problem here with Python 3.9.1, loading "C:\OSGeo4W64\bin\gdal300.dll" alone works, but loading it when using coverage.py triggers the sqlite3 error above. The bug appeared on coverage==5.0a2 (previous versions work fine with gdal dll). This alpha2 introduced "coverage/sqldata.py", maybe this new module or another breaks the loading of sqlite3.dll on Windows ? Or just triggers the loading of an sqlite3 subcomponent (because basically I don't use sqlite3 on my project, just django+postgis) ? |
BTW, this seems to be happening to many people: https://www.google.com/search?q=missing%20entry%20point%20for%20sqlite3_column_origin_name |
From the OSGeo4W shell and the same python virtualenv as usual, gdal300.dll indeed gets loaded properly :) It looks like a problem of precedence of "sqlite3.dll", between that of OSGeo4W and that of Python. I guess that Python's one doesn't have some necessary extensions (spatialite is it? or SQLITE_ENABLE_COLUMN_METADATA?), whereas OSGeo4W's has these extensions. That's why lots of problems have "sqlite3_column_origin_name" errors when using Django/Gis, but for very different reasons. But coverage.py shouldn't change the way third-party DLLs are found and/or loaded (I don't know, when everything works, if sqlite3.dll doesn't get loaded at all, or is loaded but from OSGeo4W). |
Additional investigations : ProcessExplorer shows that "working" python programs DO load sqlite3.dll and spatialite.dll from OSGeo4W's bin directory. The PATH env variable of both succeeding (normal python) and failing (coverage.py run) is exactly the same. So I suppose that sqlite3.dll is already (indirectly?) loaded, somewhere, by coverage.py, so that normal search in PATH is not used to find the sqlite3.dll, and the "wrong" Python's sqlite3.dll is used instead of OSGeo4W's sqlite3.dll There are like conflicts together there:
Changing Python's sqlite3 DLL for one of https://sqlite.org/download.html solves the problem |
Hi there, |
@MI53RE Does the solution above work for you, or maybe you have another way to solve the problem? |
@nedbat sorry for the late reply, I managed to achieve something similar as to copy past programmatically the sqlite3.dll from gdall to system32 (My use case is to create a full setup with Inno Setup), replacing the old one without side effect on my end. Before that I used to manually delete the sqlite3.dll found in system32 and everything would work fine. In one of my attempt I tried to set the env var path for the one provided by Osgeo4W before System32 but with no success. Also during my trials and errors I've managed to identify the real origin of that sqlite3, I previously falsely blamed sqlserver as the file would appears arround the same time of install but it was an old dotConnectUniversal version that would install it instead (DCU was silent install which made it less obvious). This explain why the sqlite3.dll version found was from 2016 |
I describe the situation here, as i really don't understand what's happenning.
If you have a key to help.
This is only windows env pb.
My env : Python 3.8 (with only coverage and pipenv) + GDal installed (with django and postgis and so on, but this happens in a simple config) + PostGreSQL.
the standard behaviour
My test file
testgdal.py
Output from python testgdal.py is :
OK ! Ret is C:/OSGeo4W/bin/gdal303.dll
If a wrong path or dll is missing, normal, return is for example :
Lib C:/unknown.dll is not found
If a use another dll, like C:/OSGeo4W/bin/tiff.dll, ir works with coverage run testgday.py :
OK ! Ret is C:/OSGeo4W/bin/tiff.dll
This is my expected behaviour, which is working in django, pytest environment.
The coverage error ith the gdal dll
Now, when i try to use a
coverage run testgdal.py,
it fails.And the windows system show me a modal box
My question
How come coverage run this error with sqllite ?
The text was updated successfully, but these errors were encountered: