Langchain Module Not found issue

Hey @Charly_Wargnier

any possible solution for this error -ModuleNotFoundError: No module named ‘langchain.chains.question_answering’

I searched a lot but this issue is not getting resolved

1 Like

So this doesn’t work, even if you upgrade/downgrade to a different version of LangChain?

If not, I’ll need to dig into this.

How can it possibly work locally & not on deployment. Very Strange. If you want i can share the code with you, do let me know.

Same problem, can’t get it to work… Have a requirements.txt file - still nothing

Different version of langchain.

I did try different versions of langchain, but no luck.

Use the version that works locally.

@Goyo Doing that only, but it is still not working!

It works for me. You must be doing something different.

I am having this issue as well:

Error during deployment:

2023-08-23 07:34:11.446 Uncaught app exception
Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/job-interview-assistant/main.py", line 24, in <module>
    from st_helpers.audio_helpers import load_eleven_labs_voice
  File "/mount/src/job-interview-assistant/st_helpers/audio_helpers.py", line 23, in <module>
    from langchain.chains.conversation.memory import ConversationSummaryMemory
ModuleNotFoundError: No module named 'langchain'
2023-08-23 07:34:11.489 Uncaught app exception
Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/job-interview-assistant/main.py", line 24, in <module>
    from st_helpers.audio_helpers import load_eleven_labs_voice
  File "/mount/src/job-interview-assistant/st_helpers/audio_helpers.py", line 23, in <module>
    from langchain.chains.conversation.memory import ConversationSummaryMemory
ModuleNotFoundError: No module named 'langchain'

I deployed your app and could not reproduce the issue. I got an error about secrets.json not being found, but that is expected. The langchain import just works.

1 Like

Thanks for getting back to this @Goyo Do you think I should restart my browser and clear cookies/cache? I am unsure how to resolve this. I tried rebooting the app, and it did not change anything.

You made a lot of commits after my fork. Maybe try to deploy the same version as a new application.

https://diy4fvtaq7kzbthyiql8w3.streamlit.app/

Or search your logs for error messages related to the installation of langchain.

1 Like

Hi @Goyo, Thanks for your responses! What worked for me was clearing my browser data, clearing my browser cache, and then rebooting the app. This was using google chrome.

Greetings @abhijithjainn,
Try rehosting your application on streamlit cloud. Also if you have not mentioned langchain version in the requirements.txt, do that as well. The issue should not persist.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.