You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
python-api container fails to start: greenlet missing with SQLAlchemy 2.1 #377
Describe the bug
On a fresh build, the python-api container exits with status 1 on startup. src/database/engine.py imports sqlalchemy.ext.asyncio, which needs greenlet, but greenlet is not installed:
ImportError: The SQLAlchemy asyncio module requires that the Python 'greenlet' library is installed. In order to ensure this dependency is available, use the 'sqlalchemy[asyncio]' install target: 'pip install sqlalchemy[asyncio]'
Since SQLAlchemy 2.1, greenlet is only installed with the asyncio extra (Requires-Dist: greenlet>=1; extra == "asyncio"). pyproject.toml lists plain sqlalchemy, so any new environment resolves to 2.1.x without greenlet.
docker compose ps -a shows python-api as Exited (1); docker compose logs python-api shows the error above.
Versions in the image: SQLAlchemy 2.1.7, greenlet not installed.
Environment: Ubuntu 26.04 in WSL2, Docker 29.1.3.
Expected behavior
The python-api container starts and serves the API on port 8000.
Additional context
Changing "sqlalchemy" to "sqlalchemy[asyncio]" in pyproject.toml fixes it for me: after rebuilding, the container starts and /docs loads. I'm happy to open a PR with this one-line change if that's welcome.
Activity
Jayant-kernel commentedon Nov 20, 2026
@anshuly0720
Hi, if you’re still planning to submit the fix, I’d be happy to help verify it.
Otherwise, I can pick it up if that works for you.
anshuly0720 commentedon Nov 21, 2026
Thanks @Jayant-kernel! I've opened the fix as #380. Happy to have you test it.