question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong dependencies resolving for SQLAlchemy[postgresql_asyncpg]

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

After installing SQLAlchemy with postgresql_asyncpg extra there is no greenlet dependency.

# poetry update
Creating virtualenv example-OWA4dUH3-py3.9 in /Users/.../Library/Caches/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file

Package operations: 2 installs, 0 updates, 0 removals

  • Installing asyncpg (0.25.0)
  • Installing sqlalchemy (1.4.35)
# poetry run pip freeze
asyncpg @ .../asyncpg-0.25.0.tar.gz
SQLAlchemy @ .../SQLAlchemy-1.4.35.tar.gz

Using pip:

# python -m pip install 'sqlalchemy[postgresql_asyncpg]'
...
# python -m pip freeze
asyncpg==0.25.0
greenlet==1.1.2
SQLAlchemy==1.4.35

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dimblebycommented, Oct 2, 2022

I don’t see anything much to agree or disagree with…

Per this comment I do believe that it’s a bug. I’ve a half-memory of taking a closer look back then and deciding that it was likely to be painful. But I haven’t tried again and, you never know, maybe it’ll turn out to be easy.

1reaction
anentropiccommented, Sep 30, 2022

I already have sqlalchemy[asyncio] … I see greenlet in the lock file as a dependency but it does not get installed - this is the part that’s not working

but explicitly adding greenlet via poetry add greenlet does fix it for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - SQLAlchemy with asyncpg crashing with error ...
The error disappeared after adding poolclass=NullPool to create_async_engine, so here's what engine creation looks like now:
Read more >
Problems with await in async dependencies (when ... - GitHub
After close' in console). If you run this code as it is and use curl or aiohttp to send request, then "await db.close()"...
Read more >
Asynchronous I/O (asyncio) - SQLAlchemy 1.4 Documentation
To install SQLAlchemy while ensuring the greenlet dependency is present ... "postgresql+asyncpg://scott:tiger@localhost/test", echo=True, ...
Read more >
SqlAlchemy 1.4 async ORM with FastAPI - rogulski.it
This tutorial will present how to set up a production-ready application running on FastAPI, PostgreSQL, SQLAlchemy 1.4, and alembic.
Read more >
Flask by Example – Setting up Postgres, SQLAlchemy, and ...
In part two, we'll set up our PostgreSQL database along with SQLAlchemy and ... app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found