update pip building, troubleshooting with new makefile, plus friendly error message when fail importing sklearn

This commit is contained in:
phunterlau
2015-12-07 22:29:46 -08:00
parent f3c5d9c1b6
commit a4840b0268
5 changed files with 12 additions and 16 deletions

View File

@@ -10,8 +10,11 @@ import os
from .core import DMatrix, Booster
from .training import train, cv
from .sklearn import XGBModel, XGBClassifier, XGBRegressor
from .plotting import plot_importance, plot_tree, to_graphviz
try:
from .sklearn import XGBModel, XGBClassifier, XGBRegressor
from .plotting import plot_importance, plot_tree, to_graphviz
except ImportError:
print('Error when loading sklearn/plotting. Please install scikit-learn')
VERSION_FILE = os.path.join(os.path.dirname(__file__), 'VERSION')
__version__ = open(VERSION_FILE).read().strip()