Find answers from the community

s
F
Y
a
P
Updated last month

Pydantic

did upgrade from 0.6.7 to the latest 0.7.8 , app does not boot any more...running it in flask app in gunicorn. Last few lines of error File "/Users/ashish/opt/anaconda3/envs/LLMTools/lib/python3.9/site-packages/langchain/document_loaders/github.py", line 37, in <module>
class GitHubIssuesLoader(BaseGitHubLoader):
File "pydantic/main.py", line 198, in pydantic.main.ModelMetaclass.new
File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.init
File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 663, in pydantic.fields.ModelField._type_analysis
File "pydantic/fields.py", line 808, in pydantic.fields.ModelField._create_sub_type
File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.init
File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis
File "/Users/ashish/opt/anaconda3/envs/LLMTools/lib/python3.9/typing.py", line 852, in subclasscheck
return issubclass(cls, self.origin)
TypeError: issubclass() arg 1 must be a class
L
a
17 comments
Seems like a pydantic issue
Can you do this
pip install --upgrade pydantic==1.10.0
I ran into this earlier today too, langchain likely needs to limit their pydantic version, it's breaking their code
pip show pydantic
Name: pydantic
Version: 1.10.0
Summary: Data validation and settings management using python type hints
Home-page: https://github.com/pydantic/pydantic
Author: Samuel Colvin
Author-email: s@muelcolvin.com
License: MIT
Location: /Users/ashish/opt/anaconda3/envs/LLMTools/lib/python3.9/site-packages
Requires: typing-extensions
Required-by: langchain, langsmith, openapi-schema-pydantic
still same error
should I downgrde to some other version ?
One more thing
pip install --upgrade typing-extensions==4.5.0
If that doesn't work, I would start with a fresh venv
that error is gone but I think I need to upgrade my open-ai package as well , it is breaking there
which version of open ai works
pip show openai
Name: openai
Version: 0.26.5
Summary: Python client library for the OpenAI API
Home-page: https://github.com/openai/openai-python
Author: OpenAI
upgraded openAI as well
thanks @Logan M
Perfect πŸ’ͺ
Add a reply
Sign up and join the conversation on Discord