-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite ‘no such table: json_each’ error during notification check #5970
Comments
|
As far as I can tell, the built-in version of SQLite used by Python on Windows, import aiosqlite
import asyncio
import sqlite3
async def async_main():
async with aiosqlite.connect(':memory:') as my_db:
res = await my_db.execute("""SELECT * FROM json_each('["foo", "bar", "baz"]')""")
rows = await res.fetchall()
print(rows)
def pysqlite_main():
with sqlite3.connect(":memory:") as my_db:
res = my_db.execute("""SELECT * FROM json_each('["foo", "bar", "baz"]')""")
rows = res.fetchall()
print(rows)
# asyncio.run(async_main())
pysqlite_main() Both will throw Which extensions are statically included at build time is not something SQLite has any way of letting you verify without just sending a query and checking if it fails. Building the json1 extension separately and loading it at runtime (which needs to be done per connection) could be an option, but I'm not sure how well that works with SQLAlchemy. Another option would be to have Prefect bundle sqlite3.dll and ensure it gets loaded prior to the one included in the Python standard library. That can be done easily without changing the search path by just loading the DLL via import ctypes
sqlite3_dll = ctypes.CDLL(r"C:\some\other\path\to\sqlite3.dll")
import sqlite3
import aiosqlite You can tell by running something like Combining the two code samples above with the version of |
Hi, I also hit this (Windows 10, Python 3.8, venv).
As a workaround, I replaced |
Thanks for the details! We'll do some investigation to see what we can do here. |
@lukesdm: Ah, interesting that this might be connected to the Python version. From what the release notes of each version on the Python website say, the Windows and Mac installers of Python 3.9 and 3.10 include SQlite 3.37.2 since python/cpython#90083, while Python 3.8.10 and up uses SQLite 3.35.5 and Python 3.7.8 and up uses SQLite 3.32.2. So unless I'm mistaken, none of these would include |
I believe you'll also have no problems if you use conda since it bundles SQLite with each Python environment. |
Thanks @sm-Fifteen and @madkinsz . Good to know. Sounds like conda is the way forward for Windows. |
how was above resolved? having installed prefect and run the example 'my_favotire_function" example flow I'm still getting the same error. Have tried sm-Fifteen's solution with the lastest sqlite3 dll from official website but no improvement. |
@M-Adrian-N I'd recommend using a conda environment to get the latest SQLite version. It's otherwise quite challenging to get it linked into Python correctly. |
You should be able to upgrade to the latest versions of Python 3.10 or 3.11, which should all ship with |
I haven't look much into this, but I came across the error while using python 3.8 and prefect |
Opened from the Prefect Public Slack Community
niko: Hi, we just witnessed an error when running a prefect task locally on a windows 11 machine. This error is not popping up on mac. Do you know how to fix that?
michael054: <@ULVA73B9P> open “SQLite ‘no such table: json_each’ error during notification check”
michael054: We’ll need to investigate this. Does it happen consistently?
Original thread can be found here.
The text was updated successfully, but these errors were encountered: