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
ImportError: cannot import name 'Mapped' from 'sqlalchemy.orm' (/home/nvme2/kunzhong/anaconda3/lib/python3.8/site-packages/sqlalchemy/orm/__init__.py) #3655
Comments
Same thing here. I think |
.. tip::
The :class:`_orm.Mapped` class represents attributes that are handled
directly by the :class:`_orm.Mapper` class. It does not include other
Python descriptor classes that are provided as extensions, including
:ref:`hybrids_toplevel` and the :ref:`associationproxy_toplevel`.
While these systems still make use of ORM-specific superclasses
and structures, they are not :term:`instrumented` by the
:class:`_orm.Mapper` and instead provide their own functionality
when they are accessed on a class.
.. versionadded:: 1.4 I am updating the deps to declare 1.4 as a min requirement, but i cannot assign the issue to myself :/ |
Hey added a fix for it in this PR. SQLAlchemy support for |
Updating SQLAlchemy from 1.3 to 1.4 is not "easy". It would be much better if |
Ahh, ok. I always thought the big migration was from 1.* -> 2. If it's there for annotations, then yeah, I agree with you. |
Related to [this issue.](#3655 (comment)) The `Mapped` SQLAlchemy class is introduced in SQLAlchemy 1.4 but the migration from 1.3 to 1.4 is quite challenging so, IMO, it's better to keep backwards compatibility and not change the SQLAlchemy requirements just because of type annotations.
Hi, @nickyi1990! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale. Based on my understanding, the issue you reported is an ImportError that occurs when trying to import 'Mapped' from 'sqlalchemy.orm'. It seems that the error is encountered when running code that involves the 'langchain' package. In the comments, users hrist0stoichev and MichaelJThomas-2016 discuss that 'Mapped' is from SQLAlchemy 1.4, but the current requirement is SQLAlchemy 1.3. vempaliakhil96 suggests upgrading SQLAlchemy to 1.4 and provides a fix in a PR, while hrist0stoichev suggests removing 'Mapped' and keeping the constraint for >1.3. MichaelJThomas-2016 agrees with this suggestion. The issue has been resolved by removing the import of 'Mapped' from 'sqlalchemy.orm' and keeping the constraint for SQLAlchemy version >1.3. Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days. Thank you for your contribution to LangChain! |
have no idea, just install langchain and run code below, the error popup, any idea?
The text was updated successfully, but these errors were encountered: