Bug report #21899
Spatialite isn't working correctly on macOS
|Affected QGIS version:||3.6.1||Regression?:||No|
|Operating System:||macOS||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||29714|
In QGIS 3, I have to use the Cadastre plugin.
When installing, it begins with a Python error. I could repaire it by removing all the accented letters in the metadata.txt file.
But when it comes to create a new Spatialite database, it fails.
I had exactly the same problem with the version 2.18 which with a buggy spatiality version. I could get it working by installing an older SQLite version SQLite3_Framework-126.96.36.199-1.dmg from http://www.kyngchaos.com/files/software/frameworks/SQLite3_Framework-188.8.131.52-1.dmg
But it doesn't work with version 3…
This plugin works out-of-the-box in both Windows and Linux versions and on QGIS 2.16 for Mac or with version 2.18 when installing SQLite3_Framework-184.108.40.206-1.dmg
It seems there is something broken in SQLite on the Mac version in all the recent versions from 2.18 and above.
Giovanni Manghi wrote:
isn't this a plugin problem?
No since as I explained, I got it working under 2.18 version by installing an older SQLite version.
Plus if I load manually a previously created database from the database manager, the plugin won't be able to load it as well.
When opening the framework content, you can see the Python part PySQLite of Spatialite are missing in version 3.6.
It was the same problem in SQLite framework builds released after the 3.8.7.-1 version I listed above.
Plugins which are based on this python extension aren't working at all under Mac OS X.
But since under Python 3, PySQLite isn't supported, the SQLite3 version under Mac OS is probably missing some components dedicated to the Python 3 SQLite module and Spatialite which replace PySQLite.
When I run this command in the Python console, I get an error.
with sqlite3.connect(":memory:") as conn:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/code.py", line 91, in runcode
File "<input>", line 3, in <module>
pysqlite2.dbapi2.OperationalError: dlopen(mod_spatialite.dylib, 10): image not found
- File Capture d’écran 2019-05-04 à 13.44.36.png added
This plugin does work well using PostgreSQL.
If I use this QGIS version, it does work perfectly as well.
It is definitely validating a trouble with the built of SQLite.