When I go to deploy my streamlit app I get this error: ModuleNotFoundError: No module named ‘langchain_community’
python3 -m venv env
But langchain community is installed, I’ve tested many times.
When I go to deploy my streamlit app I get this error: ModuleNotFoundError: No module named ‘langchain_community’
python3 -m venv env
But langchain community is installed, I’ve tested many times.
Please share the requirements.txt
file you’ve used to configure your deployed environment, or share a link to your repository.
langchain_community
is not installed in the environment in which your app is running.
streamlit==1.32.1
langchain-community==0.0.28
langchain-openai==0.0.8
langchain==0.1.11
faiss==1.8.0
Yes it is
The interpreter begs to differ. It doesn’t happen often that a human knows better, but it is not unheard of either. There is a cryptic reference to a virtual environment in the OP, but the error message shows that the application is not running in a virtual envirnment. What is the virtual environment for, then?
Can you share details on how you install the package, how do you test that it is installed, and how do you launch your application?
To be fair I am newer to coding so there is a high probability that I’m wrong about what I said earlier.
Not exactly sure how to tell what’s running in my virtual environment or how to make sure it’s setup properly. In the pic attached I just said “pip list” in my VSCode terminal.
Don’t want to take up too much of your time, just a point in the right direction is all and I can figure out the rest from there.
Thanks
So how are you running the application?
Does typing this in the same terminal work?
streamlit run app.py
yes, that is what brought me to the local webpage with the error.
This is the result. Also I may be incorrect, but I don’t think VSCode would let me use the langchain community packages in my code if it was installed incorrectly? Please critique me wherever I’m wrong. Happy to learn
I don’t know VSCode and I am a bit puzzled because I don’t see the terminal in the screenshot. Anyway, for whatever reason, the application is not running in the same environment as pip was
How about this? Again, in the same terminal where you run pip and it shows that langchain-community
is instaled`.
python -m streamlit run app.py
I had a similar issue because the version of streamlit was serving from outside of the venv.
Try doing: ~/path_to_your_venv/bin/streamlit run your_app.py
This fixed it for me
Maybe the default python you are running for installation is in a wrong directory.
First move on to the directory you want to install the library and then, type:
./python -m pip install langchain-community
This will force the terminal to run the python program in that directory and install the library to that python.
Hi, Could you elaborate? im getting the same error but im trying to connect it from github. Also when i was trying to run it from vscode… I had to do “ollama serve” in the powershell before streamlit run whatever.py so is that why this same error could be poppoing up for me? and how do i solve it if it is or isnt?
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.