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.
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!
Just to add to this thread. I had the same problem but it was resolved by using pipreq to generate the requirements.
I don’t know if it’s related but sklearn was the only module that installed into my local environment using pip, the rest were installed using miniconda
make sure the version of sklearn you used to create your model is the version of sklearn in your environment on anaconda. you can use pip show sklearn to see the version of your sklearn
make sure you import all your dependencies at the top of your code
add a requirements.txt file to your github repo that contains the dependencies used in your code. for instance i used: joblib==1.2.0
numpy==1.26.1
pandas==2.1.1
Pillow==10.1.0
scikit-learn==1.3.1
scipy==1.11.3
streamlit==1.27.2
statsmodels
make sure the version of sklearn here is the version you used to create your model.
make sure you add import sklearn in your web app file at the top
if you have made all these changes and you are still getting the error, login to streamlit and delete the web app you are trying to deploy and start afresh. It should work seamlessly.