Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17360

'Unable to open database file' error while using in-memory db sqlite3

$
0
0

I have created in-memory database using sqlite3 in python and execuet a query with this line

            conn = sqlite3.connect(':memory:')            df_selected.to_sql('my_table', conn, index=False)            df1 = pd.read_sql_query(sql_query, conn)   

where df is dataframe.sometimes i face this error, 'unable to open database file' when executing te query.I see no solution for this in google, so posted here.please help.

note: iam running them in flask visual studio.

First, I forgot to close the connection in the end.So i added conn.close() yet i face this issue.


Viewing all articles
Browse latest Browse all 17360

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>