I face the following errors on jupyter notebook which I believe is due to because of multiple versions of python on my laptop, I am trying import xgboost
from xgboost import XGBClassifier
I get the following error,
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) <ipython-input-4-3728958e329a> in <module>
15 from sklearn.svm import SVC
16 from sklearn.neural_network import MLPClassifier
---> 17 from xgboost import XGBClassifier
ModuleNotFoundError: No module named 'xgboost'
and I also get the following warnings when I run the kfold selection,
# evaluate each model in turn
for name, model in models:
kfold = model_selection.KFold(n_splits=10, random_state=seed)
cv_results = model_selection.cross_val_score(
model, X_train, Y_train, cv=kfold, scoring=scoring)
results.append(cv_results)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/linear_model/logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.
FutureWarning)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/linear_model/logistic.py:459: FutureWarning: Default multi_class will be changed to 'auto' in 0.22. Specify the multi_class option to silence this warning.
"this warning.", FutureWarning)
I checked the versions of python on my terminal and jupyter notebook, I see that jupyter notebook has 3.6.5 version and terminal has 3.7 version.
Not sure if this is what causing the issue.
jupyter notebook:
import sys
print(sys.version)
print(sys.path)
3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 03:03:55)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
['', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/IPython/extensions', '/Users/shafeeqrahaman/.ipython']
This issue is not just with xgboost package but happens when I try to import keras as well

