langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Sqlalchemy 2 cannot be used in projects using langchain.

Open tback opened this issue 3 years ago • 3 comments

Langchain depends on sqlalchemy<2. This prevents usage of the current version of sqlalchemy, even if neither the caching nor sqlchains features of langchain are being used.

Looking at this purely as a user it'd be ideal if langchain would be compatible with both sqlalchemy 1.4.x and 2.x.x. Implementing this might be a lot of work though. I think few users would be impacted if sqlalchemy would be converted into an optional dependency of langchain, which would also resolve this issue for me.

tback avatar Feb 24 '23 11:02 tback

+1 this. It would be great if sqlalchemy was an optional dependency since (1) we dont use it's features in langchain and (2) it conflicts with our existing codebase which depends on sqlalchemy>=2.0

tonyf avatar Feb 27 '23 17:02 tonyf

It seems like the only blocker for allowing both SQLAlchemy 1.4 and 2.0 is the dependency on duckdb-engine, which is used for Chroma. duckdb-engine is not compatible with SQLAlchemy 2.0. It looks like this may be updated soon on their end https://github.com/Mause/duckdb_engine/pull/439

jzluo avatar Feb 28 '23 01:02 jzluo

I've since released version 0.7.0-rc1 with tentative compatibility with SQLAlchemy 2, once I've heard back from a couple of projects and they've had to chance to test it, I'll release 0.7.0

Mause avatar Mar 08 '23 05:03 Mause

thanks @Mause and @alexmavr!

hwchase17 avatar Mar 17 '23 04:03 hwchase17

I think the sqlalchemy dependency in pyproject.toml still needs to be bumped.

sliedes avatar Mar 17 '23 11:03 sliedes

v0.0.27 used to have the wildcard for sqlalchemy. Maybe bring it back?

sqlalchemy = "*"

kenn avatar Mar 18 '23 09:03 kenn