Hi! I am new to the community and trying to deploy my machine learning project.
Like many people, I faced the error when calling pickle and
ModuleNotFoundError: No module named ‘sklearn’
The main file of the project is “application.py”.
Can anyone help me?
Link to public deployed app:
https://swd-salary-prediction.streamlit.app/
Here is my GitHub repository:
Streamlit and Python Versions:
Streamlit: 1.3.2
Python 3.12.0
Error message (repeated many times):
2024-01-21 01:55:06.567 503 GET /script-health-check (10.12.2.5) 145.40ms
2024-01-21 01:55:11.405 Uncaught app exception
Traceback (most recent call last):
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
exec(code, module.__dict__)
File "/mount/src/swd-salary-prediction/application.py", line 2, in <module>
from predict_page import show_predict_page
File "/mount/src/swd-salary-prediction/predict_page.py", line 10, in <module>
data = load_model()
File "/mount/src/swd-salary-prediction/predict_page.py", line 7, in load_model
data = pickle.load(file)
ModuleNotFoundError: No module named 'sklearn'
2024-01-21 01:55:11.515 503 GET /script-health-check (10.12.2.5) 112.63ms
2024-01-21 01:55:16.377 Uncaught app exception
Traceback (most recent call last):
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
exec(code, module.__dict__)
File "/mount/src/swd-salary-prediction/application.py", line 2, in <module>
from predict_page import show_predict_page
File "/mount/src/swd-salary-prediction/predict_page.py", line 10, in <module>
data = load_model()
File "/mount/src/swd-salary-prediction/predict_page.py", line 7, in load_model
data = pickle.load(file)
ModuleNotFoundError: No module named 'sklearn'
2024-01-21 01:55:16.493 503 GET /script-health-check (10.12.2.5) 119.12ms