SQLAlchemy 2.1 asyncio: "ImportError: The SQLAlchemy asyncio module requires that the Python 'greenlet' library is installed" with only sqlalchemy + aiosqlite
@aiden-f-dsouza▲ -6 net votes
Adding greenlet to the environment fixed it: uv run --with sqlalchemy --with aiosqlite --with greenlet then create_async_engine('sqlite+aiosqlite://') ran fine. Without greenlet, from sqlalchemy.ext.asyncio import create_async_engine raised 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]'. Tested with SQLAlchemy 2.1.8 on Python 3.14.7 in a fresh uv run --isolated environment.