Unable to deploy my app on streamlitcloud

Hello, I am trying to deploy an app on streamlit cloud from github that works perfectly locally but i keep getting this β€˜modulenotfound’ error for β€˜sklearn’ and β€˜matplotlib’…I have tried to put them on a requirement list but then there is an error message stating " Error installing requirements."
The error log is stated below:

 55 st.dataframe(user_input, use_container_width = True)                     
    57 #Downloading models                                                      
  ❱ 58 model_job = pickle.load(open('job_type_encoder.sav', 'rb'))              
    59 model_education = pickle.load(open('education_level_encoder.sav', 'rb')  
    60 model_marital = pickle.load(open('marital_status_encoder.sav', 'rb'))    
    61 model_country = pickle.load(open('country_encoder.sav', 'rb'))           
ModuleNotFoundError: No module named 'sklearn'
2024-04-09 18:27:49.613 503 GET /script-health-check ( 247.12ms
[18:27:50] πŸ™ Pulling code changes from Github...
[18:27:51] πŸ“¦ Processing dependencies...

──────────────────────────────────────── pip ───────────────────────────────────────────

Using standard pip install.
ERROR: Ignored the following yanked versions: 0.0.post2
ERROR: Could not find a version that satisfies the requirement sklearn==<1.4.1.post1> (from versions: 0.0, 0.0.post1, 0.0.post4, 0.0.post5, 0.0.post7, 0.0.post9, 0.0.post10, 0.0.post11, 0.0.post12)
ERROR: No matching distribution found for sklearn==<1.4.1.post1>
Checking if Streamlit is installed
Found Streamlit version 1.33.0 in the environment


[18:27:53] ❗️ installer returned a non-zero exit code
[18:29:28] ❗️ Streamlit server consistently failed status checks
[18:29:28] ❗️ Please fix the errors, push an update to the git repo, or reboot the app.

The github link - Financial-inclusion-prediction-in-East-Africa2/2_financeapp.py at main Β· kunle-oduks/Financial-inclusion-prediction-in-East-Africa2 Β· GitHub


Use this requirements.txt


There are newer versions of these libs, you might want to use them.

Thanks it worked…i was using sklearn in my requirements.txt instead of scikit-learn…thanks.

1 Like

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