Re: Getting Error: undefined symbol: sqlite3_enable_shared_cache

Jeremy Gillick <svn-guvI891tgwPqlBn2x/[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
Ok, I spoke too soon...

> $ export LD_LIBRARY_PATH=/opt/sqlite-3.3.13/lib:$LD_LIBRARY_PATH
>
>   

I set it to "/usr/local/lib/:$LD_LIBRARY_PATH", and your example Python 
code works great.  However, Trac still fails with this error:

    Creating and Initializing Project
    Failed to create environment. global name 'sqlite' is not defined
    Traceback (most recent call last):
      File
    "/usr/local/lib/python2.5/site-packages/trac/scripts/admin.py", line
    613, in do_initenv
        options=options)
      File "/usr/local/lib/python2.5/site-packages/trac/env.py", line
    124, in __init__
        self.create(options)
      File "/usr/local/lib/python2.5/site-packages/trac/env.py", line
    229, in create
        DatabaseManager(self).init_db()
      File "/usr/local/lib/python2.5/site-packages/trac/db/api.py", line
    69, in init_db
        connector.init_db(**args)
      File
    "/usr/local/lib/python2.5/site-packages/trac/db/sqlite_backend.py",
    line 121, in init_db
        cnx = sqlite.connect(path, timeout=int(params.get('timeout',
    10000)))
    NameError: global name 'sqlite' is not defined


When I try the test script packaged with pysqlite, I get this:

    $ python
    Python 2.5 (r25:51908, Nov 22 2006, 02:11:19)
    [GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
     >>> *from pysqlite2 import test*
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File
    "/usr/local/lib/python2.5/site-packages/pysqlite2/test/__init__.py",
    line 25, in <module>
        from pysqlite2.test import dbapi, types, userfunctions, factory,
    transactions,\
      File
    "/usr/local/lib/python2.5/site-packages/pysqlite2/test/types.py",
    line 24, in <module>
        import bz2, datetime
    ImportError: *No module named bz2*
     >>>


> You should be able to run trac in this environment as well ;-)
>
>
>   


Do I have to make modifications to Trac or run it through the Python 
console?

Not really knowing a lot about Python, I tried sym-linking 
/site-packages/sqlite to /site-packages/pysqlite2 and got this error 
with Trac:

    sudo ln -s site-packages/pysqlite2/ site-packages/sqlite
    sudo trac-admin /usr/local/trac/jwalk/ initenv
    ...
    Creating and Initializing Project
    Failed to create environment. 'module' object has no attribute '_sqlite'
    Traceback (most recent call last):
      File
    "/usr/local/lib/python2.5/site-packages/trac/scripts/admin.py", line
    613, in do_initenv
        options=options)
      File "/usr/local/lib/python2.5/site-packages/trac/env.py", line
    121, in __init__
        load_components(self)
      File "/usr/local/lib/python2.5/site-packages/trac/loader.py", line
    140, in load_components
        __import__(module)
      File
    "/usr/local/lib/python2.5/site-packages/trac/db/sqlite_backend.py",
    line 64, in <module>
        _ver = sqlite._sqlite.sqlite_version_info()
    AttributeError: 'module' object has no attribute '_sqlite'

I have removed that sym-link.

Any other thoughts?  Am I completely missing something?

Thanks,
Jeremy

_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.