Closed digital-idiot closed 1 month ago
@digital-idiot, it seems like you are searching for a linux dynamic library extension under OSX. Could you try the following and let me know if it works?
import sqlite3
# setup an in-memory database
con = sqlite3.connect(':memory:')
# enable loading extensions and load spatialite
con.enable_load_extension(True)
try:
con.load_extension('mod_spatialite')
except sqlite3.OperationalError:
con.load_extension('libspatialite')
If not, could you try:
import sqlite3
# setup an in-memory database
con = sqlite3.connect(':memory:')
# enable loading extensions and load spatialite
con.enable_load_extension(True)
try:
con.load_extension('mod_spatialite.dylib')
except sqlite3.OperationalError:
con.load_extension('libspatialite.dylib')
If neither of those works, I'll fire up my Mac an see if I can reproduce the problem.
@digital-idiot, it seems like you are searching for a linux dynamic library extension under OSX. Could you try the following and let me know if it works?
import sqlite3 # setup an in-memory database con = sqlite3.connect(':memory:') # enable loading extensions and load spatialite con.enable_load_extension(True) try: con.load_extension('mod_spatialite') except sqlite3.OperationalError: con.load_extension('libspatialite')
If not, could you try:
import sqlite3 # setup an in-memory database con = sqlite3.connect(':memory:') # enable loading extensions and load spatialite con.enable_load_extension(True) try: con.load_extension('mod_spatialite.dylib') except sqlite3.OperationalError: con.load_extension('libspatialite.dylib')
If neither of those works, I'll fire up my Mac an see if I can reproduce the problem.
@xylar Both of these works. Thanks for pointing out my mistake. However, I still cannot successfully do sqlite> .load libspatialite
which throws: Error: dlsym(0x8b440f50, sqlite3_spatialite_init): symbol not found
. Do you have any pointer how can I fix this?
@digital-idiot, I will freely admit that this is not a package I use myself, I just maintain it as a dependency of other things I use.
But a bit of searching around and trial-and-error suggests that this does work:
$ sqlite3
> .load mod_spatialite
It worked for me on my mac.
@gillins, let me know if you have any further thoughts on this.
I will freely admit that this is not a package I use myself, I just maintain it as a dependency of other things I use.
Same situation here! And I no longer have access to a Mac.... Thanks for investigating @xylar.
@digital-idiot, I will freely admit that this is not a package I use myself, I just maintain it as a dependency of other things I use.
But a bit of searching around and trial-and-error suggests that this does work:
$ sqlite3 > .load mod_spatialite
It worked for me on my mac.
@gillins, let me know if you have any further thoughts on this.
Resolved. Thanks @xylar
@digital-idiot, glad I could help!
Solution to issue cannot be found in the documentation.
Issue
Loading
spatialite
extension inSQLite
fails stating:Trying the following snippet in Python:
results into:
Related Issue: #49
Installed packages
Environment info