I've developed a converter for spatial data which currently runs on Windows and Linux in Python3. On Windows I need to exchange the given sqlite3.dll for the original one from the SQLite website, for the converter needs the rtree module. Now I need to get the converter running on MacOS (to which I'm quite new).

I have installed the MacOs-Python3-package from python.org, and via homebrew added GDAL and SpatiaLite. But Python3 and its SQLite installation seems to lack a couple of needed capabilities - so I can't even load the spatialite-module, as Python keeps telling me that some capabilities are lacking...

Can anybody tell me how to set up the environment on MacOS?

I followed the instructions given in the article - if I enter "sqlite3" at the command prompt the correct version (3.36.something) is given. But after starting my python3 script I still get the error-message:

AttributeError: 'sqlite3.Connection' object has no attribute 'enable_load_extension'

So, what can I do to make python recognize the new SQLite-version.

I again fiddled around a bit - with still no success. What I've tried so far: I removed al python3 installations; installed SQLite 3 following the instructions - SQLite3 tells me that loading modules is enabled; I installed libspatialite via homebrew; I then installed python3 via homebrew - this all results in the same AttributeError telling me that SQLite is not able to load extension. So I guess python still points to the original SQLite3 version. Is there a way to make python point to the correct version?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.