sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.

Python

sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.

年份
2020
分类
Python

爬学校电费余额系统存到本地数据库时,开了多线程(车速过快),于是就报错了

sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 12960 and this is thread id 13904.

QQ截图20200717022652.jpg在链接sqlite的时候加上check_same_thread=False即可