-
Notifications
You must be signed in to change notification settings - Fork 16k
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
ERROR-Import Langchain : TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers' #4401
Comments
same for me |
In databricks, the error disappears with version langchain==0.0.125 |
It works with the version 0.0.125.
Thanks @samlopezruiz for sharing this solution. I let this issue open as it works with older version.But still issue with new version. |
I have the same issue and pip install langchain==0.0.125 did not resolve it TypeError Traceback (most recent call last) File ~/opt/anaconda3/lib/python3.9/site-packages/langchain/init.py:5 File ~/opt/anaconda3/lib/python3.9/site-packages/langchain/agents/init.py:2 File ~/opt/anaconda3/lib/python3.9/site-packages/langchain/agents/agent.py:11 File ~/opt/anaconda3/lib/python3.9/site-packages/pydantic/init.py:2, in init pydantic.init() File ~/opt/anaconda3/lib/python3.9/site-packages/pydantic/dataclasses.py:48, in init pydantic.dataclasses() File ~/opt/anaconda3/lib/python3.9/site-packages/pydantic/main.py:120, in init pydantic.main() TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers' |
I am also facing same issue tried pip install langchain, pip install -q langchain, none of them are working getting TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers'. pip install langchain==0.0.125 using this I am getting error |
Hi @Abonia1 @zinniz @jigsawmetric Would you mind specifying which Databricks Runtime version are you using? I tested with |
This probably is not langchain issue, but it is issue of Could you try to install langchain |
@WeichenXu123 Do you mean
We are able to reproduce the issue with |
sorry. yes we should install |
As @WeichenXu123 and @liangz1 mentioned, we believe the root cause is
The remaining question is why and how
|
I found |
Shall we upgrade |
@WeichenXu123 We don't need to. |
@Abonia1 How did you install |
@harupy @WeichenXu123 Finally I can install and import recent version of langchain in databricks with DBR 12.2 LTS runtime. Just do: Thanks for all the support. |
I still had problems using typing-extensions>=4.2.0. However, pinning to 4.5.0 worked.
|
i'm also getting this error and tried the solutions above to no avail using python 3.9 and langchain 0.0.189 Error for context:
|
langchain== 0.0.219, typing-extensions==4.2.0 works for me |
when I do typing-extensions==4.2.0, got an error that chromadb requires >4.7. |
Update: Created a new environment with Python version 3.9.12. then installed langchain(pip install langchain) and chromadb (pip install chromadb), and no errors with the following line (which was the issue before): from langchain.vectorstores import Chroma |
Hi @liangz1 My Databricks Runtime version is 12.2 LTS (includes Apache Spark 3.3.2, Scala 2.12) with langchain==0.0.125 and 0.0.235 and I have encountered the same error. Could you please take a look? Thank you in advance. |
Hi @Feya , would you mind checking if there is any error from the |
Initially facing this issue, upgraded to the Databricks runtime version to 13.2 and it is working. |
This worked for me with langchain==0.0.248 |
use databricks runtime version as 13.0 while creating the cluster. Hope it helps. |
Hi, @Abonia1. 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. From what I understand, you encountered a 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 this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the LangChain project. Let us know if you have any further questions or concerns. |
In databricks I cant able to import langchain.
TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers'
Thanks in advance.
The text was updated successfully, but these errors were encountered: