Reputation: 1366
I am trying to use XGBoost on Sagemaker notebook.
I am using conda_python3
kernel, and the following packages are installed:
But once I am trying to import xgboost it fails on import:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-5-5943d1bfe3f1> in <module>()
----> 1 import xgboost as xgb
ModuleNotFoundError: No module named 'xgboost'
Upvotes: 0
Views: 2490
Reputation: 180
In Sagemaker notebooks use the below steps
i) !type python3
ii) Say the above is /home/ec2-user/anaconda3/envs/python3/bin/python3 for you
iii) !/home/ec2-user/anaconda3/envs/python3/bin/python3 -m pip install xgboost
iv) import xgboost
i) conda activate conda_python3
ii) pip install xgboost
Disclaimer : sometimes the installation would fail with gcc version ,in that case update pip version before running install
Upvotes: 3