I am getting this module not found error while deploying the app

If you’re creating a debugging post, please include the following info:

  1. Share the link to the public app (deployed on Community Cloud): shibal4
  2. Share the link to your app’s public GitHub repository (including a [requirements file]) - GitHub - elinordula/sample2
  3. Share the full text of the error message. ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).
    Traceback:
    File “/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py”, line 88, in exec_func_with_error_handling
    result = func()
    ^^^^^^
    File “/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 579, in code_to_exec
    exec(code, module.dict)
    File “/mount/src/sample2/shibal4.py”, line 5, in
    import nltk
  4. Share the Streamlit and Python versions.
    D:\Mridula\stud chatbot\stupid\final code>python --version
    Python 3.12.5

D:\Mridula\stud chatbot\stupid\final code>streamlit --version
Streamlit, version 1.39.0

D:\Mridula\stud chatbot\stupid\final code>

Hi @Mridula, welcome to the forum!

You need to include a file called requirements.txt which includes all the packages that you need for your app – looking at sample2/shibal1.py at main · elinordula/sample2 · GitHub, it appears that you need at least nltk and scikit-learn

Please read more here App dependencies for your Community Cloud app - Streamlit Docs

at best in your local environment run a

pip freeze > requirements.txt

to generate the requirements.txt as blackary pointed out