Joblib

File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script
    exec(code, module.__dict__)File "/mount/src/heart-disease-prediction-app/heart_disease_app.py", line 2, in <module>
    import joblib

Hi @Vikas_Yadav . Have you mentioned joblib in your requirements.txt file??? If not mention it and reboot the application.

Hope it works well !!!

Happy Streamlit-ing :balloon:

File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/heart-disease-prediction-app/heart_disease_app.py", line 8, in <module>
    model = joblib.load(r'heart_disease_prediction_model.joblib')
  File "/home/adminuser/venv/lib/python3.9/site-packages/joblib/numpy_pickle.py", line 658, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/home/adminuser/venv/lib/python3.9/site-packages/joblib/numpy_pickle.py", line 577, in _unpickle
    obj = unpickler.load()
  File "/usr/local/lib/python3.9/pickle.py", line 1212, in load
    dispatch[key[0]](self)
  File "/usr/local/lib/python3.9/pickle.py", line 1537, in load_stack_global
    self.append(self.find_class(module, name))
  File "/usr/local/lib/python3.9/pickle.py", line 1579, in find_class
    __import__(module, level=0)
ModuleNotFoundError: No module named 'sklearn'

after mention joblib above error occured

Hey you need to mention all the dependencies which you are using in your streamlit app.py file. For sklearn you need to add scikit-learn in your dependencies file.

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