ModuleNotFoundError with joblib

Hi,
I’m deploying a text classification model on streamlit share, but it seems to have problems with importing modules. I have a requirements.txt.

It does seem to install the module fine, but it does not import properly.

Collecting joblib==1.0.1
  Downloading joblib-1.0.1-py3-none-any.whl (303 kB)

Traceback (most recent call last):
File “/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py”, line 333, in _run_script
exec(code, module.dict)
File “/app/survey-response-processing/frontend.py”, line 2, in
from joblib import load
ModuleNotFoundError: No module named ‘joblib’
[client] Connecting…

The joblib package is probably not the problem.
I suspect that the deployment of the requirements fails, i am quite sure there are more error messages there?
Then I also notice that your requirements.txt is quite long, do you really need all the libs? I guess not.
For example pywin32 will fail to deploy on streamlit sharing - because this is not a windows host.
Therefore please declutter your requirements.txt file.
Use only the actual needed packages by your application and try again.

1 Like