Unable to load from langchain.embeddings.openai

#1
by finaspirant - opened

I have made a very simple streamlit chat application. When I run below code in my local environment it runs file. But on streamlit (with python version 3.11) it always gives error. Any help !!

from langchain.embeddings.openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()

ImportError: Could not import openai python package. Please install it with pip install openai.
Traceback:
File "/home/user/.local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "/home/user/app/app.py", line 14, in
embeddings = OpenAIEmbeddings()
^^^^^^^^^^^^^^^^^^

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment