question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No sqlite3 causes issue on import of PaginatedQuery

See original GitHub issue

I use MySQL and don’t need sqlite3.

from playhouse.flask_utils import PaginatedQuery

gives me this error:

FTS_VER = sqlite3.sqlite_version_info[:3] >= (3, 7, 4) and 'FTS4' or 'FTS3'
AttributeError: 'NoneType' object has no attribute 'sqlite_version_info'

line that causes error

I’m in the google app engine development environment, so I believe sqlite3 gets set to None when the ImportError is caught. My hacky fix is an if/else setting FTS_VER to None if there’s no sqlite3.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
avish-3pgcommented, Oct 8, 2017

Still facing the sqlite3 issue, even though we are using peewee==2.10.1. Please advice at the earliest. Thank you.

Error Stack Trace - ‘NoneType’ object has no attribute ‘sqlite_version_info’: AttributeError Traceback (most recent call last): File “/var/task/handler.py”, line 511, in lambda_handler return LambdaHandler.lambda_handler(event, context) File “/var/task/handler.py”, line 242, in lambda_handler return handler.handler(event, context) File “/var/task/handler.py”, line 335, in handler app_function = self.import_module_and_get_function(whole_function) File “/var/task/handler.py”, line 233, in import_module_and_get_function app_module = importlib.import_module(module) File “/var/lang/lib/python3.6/importlib/init.py”, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “”, line 978, in _gcd_import File “”, line 961, in _find_and_load File “”, line 950, in _find_and_load_unlocked File “”, line 655, in _load_unlocked File “”, line 678, in exec_module File “”, line 205, in _call_with_frames_removed File “/var/task/schedular.py”, line 16, in import models_postgres as models File “/var/task/models_postgres.py”, line 4, in from playhouse.db_url import connect File “/var/task/playhouse/db_url.py”, line 118, in from playhouse.berkeleydb import BerkeleyDatabase File “/var/task/playhouse/berkeleydb.py”, line 10, in sqlite3_lib_version = sqlite3.sqlite_version_info AttributeError: ‘NoneType’ object has no attribute ‘sqlite_version_info’

0reactions
coleifercommented, Oct 8, 2017

Thanks for the traceback, that helped me narrow it down.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot import SQLite with Python 2.6 - Stack Overflow
The error: ImportError: No module named _sqlite3. means that SQLite 3 does not find the associated shared library. On Mac OS X it's...
Read more >
Issue importing csv file to db - SQLite Forum
I have used the SQLite shell's .import command to bring very large files into a DB, without any issues. I can also attest,...
Read more >
Playhouse, extensions to Peewee
from playhouse.sqliteq import SqliteQueueDatabase db ... so for this reason peewee will not automatically call commit() after executing a SELECT query.
Read more >
sqlite3 — DB-API 2.0 interface for SQLite ... - Python Docs
import sqlite3 con = sqlite3.connect('example.db'). The special path name :memory: can be provided to create a temporary database in RAM.
Read more >
How To Use the sqlite3 Module in Python 3 - DigitalOcean
import sqlite3 gives our Python program access to the sqlite3 module. ... Since we have not executed any SQL commands yet, 0 total_changes ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found