codeinterpreter-api
codeinterpreter-api copied to clipboard
No module named 'langchain.pydantic_v1'
I am getting this error "No module named 'langchain.pydantic_v1' while executing the below code:
with CodeInterpreterSession() as session:
# generate a response based on user input
response = session.generate_response(
"Plot the bitcoin chart of year 2023"
)
# output the response
response.show()
I installed the packages using pip install "codeinterpreterapi[all]"
Any ideas how to solve it?
Also getting the error "cannot import name 'settings' from 'codeinterpreterapi'"
Same. And when you install it, it ends up conflicting with a couple of things (mainly the issue being FastAPI -- althought Chainlit too if you are using that):
If you are using pydantic v2+
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
chainlit 0.6.402 requires pydantic<2.0.0,>=1.10.8, but you have pydantic 2.3.0 which is incompatible.
fastapi 0.99.1 requires pydantic!=1.8,!=1.8.1,<2.0.0,>=1.7.4, but you have pydantic 2.3.0 which is incompatible.
vs
If you are using pydantic v<2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
codeboxapi 0.0.19 requires pydantic<3,>=2, but you have pydantic 1.10.12 which is incompatible.
codeinterpreterapi 0.0.12 requires pydantic<3,>=2, but you have pydantic 1.10.12 which is incompatible.
pydantic-settings 2.0.3 requires pydantic>=2.0.1, but you have pydantic 1.10.12 which is incompatible.
for me fast api and its working i am using a down graded version (codeinterpreterapi==0.0.7),downgrading may help , also while using fast api my openai imports also failed to work then try installing using (conda install -c conda-forge openai)
but when i am using JWT authenticationin fast api ,i am getting error
Process SpawnProcess-1:
Traceback (most recent call last):
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/site-packages/uvicorn/subprocess.py", line 61, in subprocess_started
target(sockets=sockets)
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/site-packages/uvicorn/server.py", line 48, in run
loop.run_until_complete(self.serve(sockets=sockets))
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/site-packages/uvicorn/server.py", line 55, in serve
config.load()
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/site-packages/uvicorn/config.py", line 308, in load
self.loaded_app = import_from_string(self.app)
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/site-packages/uvicorn/importer.py", line 20, in import_from_string
module = importlib.import_module(module_str)
File "/data/data/minicoda2/envs/ecom_auto/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "