XGBOOST module not found

Can anyone help me with this?

────────────────────── Traceback (most recent call last) ───────────────────────
  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptru  
  nner/script_runner.py:584 in _run_script                                      
                                                                                
  /mount/src/creditriskcomodeling/app.py:8 in <module>                          
                                                                                
     5                                                                          
     6 # Load the pre-trained GBT model                                         
     7 model_filename = 'finalized_model.pkl'                                   
  ❱  8 model = pickle.load(open(model_filename, 'rb'))                          
     9                                                                          
    10 # Title and description                                                  
    11 st.title("Loan Default Prediction with Gradient Boosted Trees")          
────────────────────────────────────────────────────────────────────────────────
ModuleNotFoundError: No module named 'xgboost'
2024-04-20 23:56:34.274 503 GET /script-health-check (10.12.146.153) 101.88ms
```[23:57:58] πŸ“¦ Processed dependencies!




────────────────────── Traceback (most recent call last) ───────────────────────

  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptru  

  nner/script_runner.py:584 in _run_script                                      

                                                                                

  /mount/src/creditriskcomodeling/app.py:5 in <module>                          

                                                                                

     2 import pandas as pd                                                      

     3 import numpy as np                                                       

     4 import pickle                                                            

  ❱  5 import xgboost as xgb                                                    

     6                                                                          

     7 # Load the pre-trained GBT model                                         

     8 model_filename = 'finalized_model.pkl'                                   

────────────────────────────────────────────────────────────────────────────────

ModuleNotFoundError: No module named 'xgboost'
Link to my github: https://github.com/abh2050/creditriskcomodeling/blob/main/app.py

In your requirements.txt file add xgboost.

1 Like

Thank you. This was fixed.