-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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
TypeError: issubclass() arg 1 must be a class when using langchain in azure #7548
Comments
Answer generated by a 🤖 AnswerI found related issues that might be helpful. I did my best to summarize the solutions, but I recommend looking at the related issues yourself. Closed Issuesimport langchain with python<=3.9 failsThe suggested solution is: Upgrade Pydantic to version 1.10.8 by running Open IssuesTypeError: issubclass() arg 1 must be a class (importing AsyncCallbackHandler)The suggested solution is: The error seems to be related to a circular import issue in the LangChain library. As a user, you can't directly fix this issue because it's related to the internal structure of the LangChain library. The library's maintainers need to resolve this issue. In the meantime, you can try to import the from langchain.callbacks.async_handler import AsyncCallbackHandler If this doesn't work, you'll need to wait for a fix from the LangChain team. You should report this issue to them if you haven't already. Error occurs when
|
I'm experiencing the same issue with |
yea believe there's a chromdb <> pydantic incompatibility in latest chroma release. try see #7522 as well |
I am experiencing the same issue as well but pip install chromadb==0.3.26 pydantic==1.10.8 did not work |
here is my requirements.txt and works like a charm
I used the latest version of both langchain, chroma, and openai |
Using pydantic==1.10.8 in my requirements.txt fixed the problem for me |
A word of caution for anyone else reading this thread. Some of these fixes don't work in certain combinations. Start with just the Edit: As mentioned below by @Pierian-Data, what worked for me was to set the version for |
Also experiencing this but specifying versions fixed it, just be careful what order you install things in, pydantic needs to be last, since chromdb will overwrite to latest pydantic, causing the issue again. |
@Pierian-Data you are right. So, what's the fix? Downgrade ChromaDB, if any versions use pydantic < 1.10.8? |
Its the versions @sitloboi2012 said:\ typing-inspect==0.8.0 caveat being they need to be installed in that order. Some people visiting this thread are saying those versions don't work, but its likely because the installed the correct versions, just not in the right order. If you do pydantic first and chromadb last, chromadb will overwrite pydantic to a new version. Best of luck |
Any suggestions for how to deal with this for poetry-managed dependencies? |
I don't think it's possible with poetry or pipenv because those tools check for conflicting dependencies. OTOH pip lets the conflict slip through and... it happens to work 😅 |
when I try your versions: I get an error: **ERROR: Cannot install -r requirements.txt (line 10), -r requirements.txt (line 4) and pydantic==1.10.8 because these package versions have conflicting dependencies. The conflict is caused by: |
comment from @baskaryan worked pip install chromadb==0.3.26 pydantic==1.10.8 |
With chromadb
|
pydantic==1.10.8 worked. Thank You! |
hey everyone, Jeff from Chroma here, the fastapi bump with the pydantic bump caused a bunch of type errors in Chroma - we made an issue to fix this up chroma-core/chroma#785 |
pydantic=1.10.8 didn't work for me and my problem is local. If I put just line below in a Jupyter Notebook (Visual Studio Code extension) I got the error: from langchain.embeddings.openai import OpenAIEmbeddings |
I have found that
will work for me sometimes. If it doesn't work, |
Chroma is updating our deps chroma-core/chroma#799 - landing as soon as tests pass and then cutting a new release. |
This worked for me. Thanks! |
(jeff from chroma) FYI - this should all be cleaned up now with |
This occurred when I was using python 3.8, upgrading the python version to 3.9 solved the issue for me. |
System Info
langchain 0.0.225 also tested with 0.0.229
I can only reproduce it in Azure, I cant reproduce it locally.
Who can help?
I have a simple python app with streamlit and langchain, I am deploying this to Azure via CI/CD with the following YAML definition
My requirements file is:
However I am getting the following error:
I am not copying here the app script as the code works locally, I think its something more related to Azure App Service Plan Environment or the venv setup in the yaml file.
Information
Related Components
Reproduction
n/a
Expected behavior
code should work :)
The text was updated successfully, but these errors were encountered: