Open harshit-ambitio opened 23 hours ago
facing the same issue
Hey!
What version of pydantic are you folks on?
@csgulati09 we are using cashfree-pg===4.3.0 as our payment gateway , and cashfree is internally install pydantic-1.10.19
Even in our SDK we have 1.10.0 as the bare minimum requirement
install_requires =
...
pydantic>=1.10.0
...
I think this should not be a major problem to resolve, can you check the current version of pydantic by running pip show pydantic
yes it's 1.10.9.
What i feel it is doing is we already had cashfree-pg package , but installing portkey-ai , it changed pydantic version to 2.x.x and that was breaking cashfree-pg. But if i uninstall both and install portkey sdk first then cashfree , then cashfree is ignoring the pydantic installation.
Edit : Sorry it will throw error once we start using it with openAI clients.
Error Log:
<module>
from portkey_ai.api_resources.client import AsyncPortkey, Portkey
File "/Users/harshitrathi/Documents/Ambitio/ambitio-backend/env/lib/python3.10/site-packages/portkey_ai/api_resources/client.py", line 6, in <module>
from portkey_ai.api_resources.base_client import APIClient, AsyncAPIClient
File "/Users/harshitrathi/Documents/Ambitio/ambitio-backend/env/lib/python3.10/site-packages/portkey_ai/api_resources/base_client.py", line 22, in <module>
from portkey_ai.api_resources.apis.create_headers import createHeaders
File "/Users/harshitrathi/Documents/Ambitio/ambitio-backend/env/lib/python3.10/site-packages/portkey_ai/api_resources/apis/create_headers.py", line 3, in <module>
from portkey_ai.api_resources.utils import get_portkey_header
File "/Users/harshitrathi/Documents/Ambitio/ambitio-backend/env/lib/python3.10/site-packages/portkey_ai/api_resources/utils.py", line 8, in <module>
from pydantic import BaseModel, field_validator
ImportError: cannot import name 'field_validator' from 'pydantic' (/Users/harshitrathi/Documents/Ambitio/ambitio-backend/env/lib/python3.10/site-packages/pydantic/__init__.cpython-310-darwin.so)
What you can also try is to install a specific version for pydantic. This will override the existing version of the package.
This can be done by running pip install pydantic===a.b.c
(Though, pydantic is encouraging users to move to 2.x.x of their package.)
Yes , although in that cashfree-pg breaks , still if i have pydantic version of 1.10.19 , portkey-ai sdk should not break right , still it breaking , you can see in the above error log.
Got it! Just one more thing, the above error that you posted, that came after you set pydantic version to 1.10.19?
Yes @csgulati09
Cool. Planning to release a fix by today EoD. I have identified the issue, looking for a way to fix in a better way.
Cool , Thank you @csgulati09
Hey! The PR is raised for this. Will be doing final checks and then merging it.
Okay , let me know when it's deployed.
Contact Details
harshit@ambitio.in
What happened?
After installing portkey in a Django project which is using cashfree-pg as the payment gateway , it started throwing error of pydantic.
Version
0.1.xx (Default)
Relevant log output
Code of Conduct