Extract-msg module error python


My app requires using the python module “extract-msg”. In particular, I am using the extract_msg.message_base.MessageBase function. I have included in my requirements.txt file “extract-msg==0.42.1” and my log when I deploy on Streamlit Cloud shows that “extract_msg-0.42.1-py2.py3-none-any.whl” was downloaded. However, when I tried to run the MessageBase function, it shows error AttributeError: module ‘extract_msg’ has no attribute ‘message_base’.

When I run the app locally, the python module ‘extract-msg’ is working fine and there are no errors.

Debug info

  • Streamlit version: v1.25.0
  • Browser: Windows

Requirements file


Hi @Benben1,

Thanks for posting!

One possibility is that the extract-msg library might have dependencies that are installed on your local machine but not on your deployed app. Check if there are any implicit dependencies you might be missing in your requirements.txt.

You can create a venv (virtual environment) in your local app then install the requirements in there and try running the app locally to see if it runs.

The error message is correct, there is indeed no attribute message_base in this version.
Probably you are using a different version of extract_msg on your local system.

Hmm, im using version 0.41.5. But, I have updated my requirements.txt file to match the extract-msg version used in my local machine. But, I am still facing the same error in the deployed app.

Works for me in Streamlit Cloud using extract-msg==0.41.5. You must be doing something different.

It is very weird because the first time I deployed the app on streamlit cloud, there were no issues. And then because of inactivity, the deployment was paused. When I re-deployed, i am getting the error. Any ideas on what I should do?

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