Py.Cafe

maartenbreddels/

dlopen-bug

calling dlopen twice

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# see https://github.com/asg017/sqlite-vec/issues/135
import sqlite3
import sqlite_vec
import streamlit as st

db = conn = sqlite3.connect(":memory:")
db.execute("CREATE TABLE movie(title, year, score)")
conn.enable_load_extension(True)


# sqlite_vec.load(db)

import os
path = os.path.abspath(os.path.dirname(sqlite_vec.__file__))
ext_path = os.path.join(path, "vec0")
st.write(os.listdir(path))
# ok, tries to load vec0 and fails, then vec0.so and succeeds
conn.load_extension(ext_path)
# finds vec0, and tries to find sqlite3_vec_init
conn.load_extension(ext_path)

st.write("Run")
requirements.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

streamlit==1.27.2  # currently pinned to this version
#pyarrow==17.0.0

sqlite3 @ https://py.cafe/files/maartenbreddels/sqlite-vec-demo/sqlite3-1.0.0-py2.py3-none-any.whl
sqlite_vec @ https://py.cafe/files/maartenbreddels/sqlite-vec-demo/sqlite_vec-0.1.3-cp312-cp312-pyodide_2024_0_wasm32.whl