On Wed, Jul 10, 2019, at 12:12 PM, Michael Lane wrote: > I tried all combination for path with your exemple and always got the same > error message: > > conn.load_extension('c:\\mydll\\mod_spatialite') > sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) OsError 0xc1 (193) > > > conn = sqlite3.connect(*":memory:"*) > conn.enable_load_extension(True) > conn.load_extension(*'c:\\mydll\\mod_spatialite'*) > > If I don't add enable_load_extension, i got a "not authorized" message > instead of the previous error. > > Sorry for my ignorance but I don't understand what you tell me to do with > cPython.
Subscribe to this mailing list: https://mail.python.org/mailman/listinfo/python-list then ask them there about this error you get when you use sqlite3 directly. > > Le mercredi 10 juillet 2019 10:58:27 UTC-4, Mike Bayer a écrit : >> I have no information on that, this has to do with the sqlite3 module >> included with Python: >> >> import sqlite3 >> >> conn = sqlite3.connect(":memory:") >> conn.load_extension("c:\\path\\to\\dll") >> >> Use cPython resources to get help and use the above code as what you're >> trying to get to work: >> >> https://www.python.org/community/lists/ >> >> >> >> >> >> On Wed, Jul 10, 2019, at 10:39 AM, Michael Lane wrote: >>> Try to reproduce this >>> <https://geoalchemy-2.readthedocs.io/en/latest/spatialite_tutorial.html> in >>> windows. How to do that? >>> >>> >>> >>> Even though I put the dll file in a directory defined in %PATH% or try >>> with/without full path, with/without file extension, with '//' or '\', with >>> libspatialite-4.dll or using excute with all combination mentionned >>> before... >>> dbapi_conn.execute("SELECT load_extension('mod_spatialite.dll')") >>> >>> >>> For example i tried this kind of combinaison: >>> >>> def load_spatialite(dbapi_conn, connection_record): >>> dbapi_conn.load_extension(*'C:*\\*Scripts*\\*mod_spatialite.dll'*) >>> # dbapi_conn.load_extension('C:\\Scripts\\libspatialite-4.dll') >>> # dbapi_conn.load_extension('mod_spatialite') >>> # dbapi_conn.load_extension('mod_spatialite.dll') >>> # dbapi_conn.execute("SELECT >>> load_extension('C:\\pyramid\\risc\\api\\Scripts\\mod_spatialite.dll')") >>> # dbapi_conn.execute("SELECT load_extension('mod_spatialite.dll')") >>> # dbapi_conn.execute("SELECT load_extension('mod_spatialite')") >>> # dbapi_conn.load_extension('C:/Scripts\mod_spatialite.dll') >>> >>> >>> >>> Can make it work, always getting: >>> >>> dbapi_conn.load_extension('C:\\Scripts\\mod_spatialite.dll') >>> sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) OsError 0xc1 >>> (193) (Background on this error at: http://sqlalche.me/e/e3q8) >>> >>> >>> Any hint will be appreciated. >>> >>> Thanks >>> >>> -- >>> SQLAlchemy - >>> The Python SQL Toolkit and Object Relational Mapper >>> >>> http://www.sqlalchemy.org/ >>> >>> To post example code, please provide an MCVE: Minimal, Complete, and >>> Verifiable Example. See http://stackoverflow.com/help/mcve for a full >>> description. >>> --- >>> You received this message because you are subscribed to the Google Groups >>> "sqlalchemy" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to sqlal...@googlegroups.com. >>> To post to this group, send email to sqlal...@googlegroups.com. >>> Visit this group at https://groups.google.com/group/sqlalchemy. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/sqlalchemy/31ce59e1-ac35-45ae-b584-d50a594adc70%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/sqlalchemy/31ce59e1-ac35-45ae-b584-d50a594adc70%40googlegroups.com?utm_medium=email&utm_source=footer>. >>> For more options, visit https://groups.google.com/d/optout. >> > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at https://groups.google.com/group/sqlalchemy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/89626ede-54f0-4353-8669-fa8ca8e38976%40googlegroups.com > > <https://groups.google.com/d/msgid/sqlalchemy/89626ede-54f0-4353-8669-fa8ca8e38976%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/8a171c99-9c0e-4a4a-895f-43a7d4bc4d08%40www.fastmail.com. For more options, visit https://groups.google.com/d/optout.