Error related to docx package 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 t

I am getting this error when deploying the app on the cloud ( works just fine when run it locally)

this is my requirement.txt file https://github.com/LeinaEssakalli/GenAItool_AlMadaVentures/blob/master/requirements.txt

Can you please help?
Thank you

Hey @Leina_Essakalli-Hous,

Can you share the full 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.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)File "/mount/src/genaitool_almadaventures/app.py", line 14, in <module>
    from docx import DocumentFile "/home/adminuser/venv/lib/python3.9/site-packages/docx.py", line 30, in <module>
    from exceptions import PendingDeprecationWarning

There should be a longer error message in the console on the righthand side. Without seeing the full error message, it looks like this error is related to python-docx. From some quick Googling, one of the suggested solutions is to also install docx

Hi Caroline,

I tried to install the docx package but it’s not helping.

Here is the full error

ModuleNotFoundError: No module named 'exceptions'
[15:02:55] 🐙 Pulling code changes from Github...
[15:02:56] 📦 Processing dependencies...
[15:02:56] 📦 Processed dependencies!
[15:02:59] 🔄 Updated app!
2023-08-04 15:03:03.974 Uncaught app exception
Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/genaitool_almadaventures/app.py", line 14, in <module>
    from docx import Document
  File "/home/adminuser/venv/lib/python3.9/site-packages/docx.py", line 30, in <module>
    from exceptions import PendingDeprecationWarning
ModuleNotFoundError: No module named 'exceptions'
2023-08-04 15:06:21.398 Uncaught app exception
Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/genaitool_almadaventures/app.py", line 14, in <module>
    from docx import Document
  File "/home/adminuser/venv/lib/python3.9/site-packages/docx.py", line 30, in <module>
    from exceptions import PendingDeprecationWarning
ModuleNotFoundError: No module named 'exceptions'
2023-08-04 15:06:52.617 Thread 'MainThread': missing ScriptRunContext
2023-08-04 15:06:52.617 Thread 'MainThread': missing ScriptRunContext
2023-08-04 15:07:03.531 Uncaught app exception
Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/genaitool_almadaventures/app.py", line 14, in <module>
    from docx import Document
  File "/home/adminuser/venv/lib/python3.9/site-packages/docx.py", line 30, in <module>
    from exceptions import PendingDeprecationWarning
ModuleNotFoundError: No module named 'exceptions'

Hi Caroline,
Can you help me get unblocked on this please?

It’s quite urgent
Thank you

From digging through StackOverflow, this seems to be related to compatibility issues between python-docx and Python 3. I’ve forked your repo and I’m playing around with different Python versions – I haven’t found a solution yet, but that’s the avenue I would recommend exploring. These threads might also be helpful:

Hi Caroline,

Thank you so much for your help !
I think I figure it out -
I need to specify the python version to be 3.8 when creating the app

Many thanks

1 Like

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