Module not found when deploying streamlit via github

Hi,

I am getting the following error on my app:
ModuleNotFoundError: No module named ‘sklearn’

I have triple checked my requirements.txt, which specifies sklearn with the correct version, so am I at a loss about how to troubleshoot this issue.

Here is my app:
https://share.streamlit.io/mvantieghem/mcc_metastasis/master/live_app.py

Hi @mvantieghem, just double-checking on a possible easy solution. Have you tried having scikit-learn instead of sklearn in the requirements.txt?

Matteo

Hi Monchier, yes I jus tried that and same error. I don’t have to do anything to re-launch the app other than push the changes to github, correct?

Hi @mvantieghem!

From the logs, it looks like an error in the requirements.txt file:

Collecting absl-py==0.10.0
  Using cached absl_py-0.10.0-py3-none-any.whl (127 kB)
Collecting alabaster==0.7.12
  Using cached alabaster-0.7.12-py2.py3-none-any.whl (14 kB)
Requirement already up-to-date: altair==4.1.0 in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (4.1.0)
Collecting applaunchservices==0.2.1
  Using cached applaunchservices-0.2.1-py3-none-any.whl (6.1 kB)
Collecting appnope==0.1.0
  Using cached appnope-0.1.0-py2.py3-none-any.whl (4.0 kB)
Collecting argh==0.26.2
  Using cached argh-0.26.2-py2.py3-none-any.whl (30 kB)
Processing /opt/concourse/worker/volumes/live/c4db8eed-7de0-4d68-400c-2ea7e21d3750/volume/argon2-cffi_1596828478065/work
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/opt/concourse/worker/volumes/live/c4db8eed-7de0-4d68-400c-2ea7e21d3750/volume/argon2-cffi_1596828478065/work'

2020-10-13 01:57:49,231 INFO exited: pip (exit status 1; not expected)

This error should be visible in the companion terminal on the app page. I suspect the error is due to the local path on your workstation not being available in Streamlit Sharing.

Hope this helps!


Amey

Hi Amey, thanks. I am not sure when the streamlit deployment instructions changed to use pipreqs to generate the requirements.txt, but that worked perfectly. My app is working!