Skip to content
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

Error when running mesa_example: sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. #13

Open
andrewchch opened this issue Jan 14, 2024 · 2 comments

Comments

@andrewchch
Copy link

Hi, I'm trying to run mesa_example/start.py but get this error regardless of how I run it (either through Pycharm or command prompt):

Traceback (most recent call last): File "C:\Users\Andrew\PycharmProjects\abce\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 377, in _close_connection self._dialect.do_terminate(connection) File "C:\Users\Andrew\PycharmProjects\abce\venv\Lib\site-packages\sqlalchemy\engine\default.py", line 698, in do_terminate self.do_close(dbapi_connection) File "C:\Users\Andrew\PycharmProjects\abce\venv\Lib\site-packages\sqlalchemy\engine\default.py", line 701, in do_close dbapi_connection.close() sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 16296 and this is thread id 26788.

Any ideas?

@rht
Copy link
Member

rht commented Jan 14, 2024

I don't have access to a Windows machine to be able to debug. That Mesa example already uses Mesa's data collector. What about commenting out all the lines containing self._db in https://github.com/AB-CE/abce/blob/master/abcEconomics/__init__.py, and install from the repo pip install .?

@rht
Copy link
Member

rht commented Jan 14, 2024

That Mesa example already uses Mesa's data collector.

As such, it is redundant with abcEconomics' data collector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants