diff --git a/python-package/lightgbm/__init__.py b/python-package/lightgbm/__init__.py index b679b3f665b5..b53d8176948c 100644 --- a/python-package/lightgbm/__init__.py +++ b/python-package/lightgbm/__init__.py @@ -10,21 +10,10 @@ # and its dependencies as early as possible from .basic import Booster, Dataset, Sequence, register_logger from .callback import EarlyStopException, early_stopping, log_evaluation, record_evaluation, reset_parameter +from .dask import DaskLGBMClassifier, DaskLGBMRanker, DaskLGBMRegressor from .engine import CVBooster, cv, train - -try: - from .sklearn import LGBMClassifier, LGBMModel, LGBMRanker, LGBMRegressor -except ImportError: - pass -try: - from .plotting import create_tree_digraph, plot_importance, plot_metric, plot_split_value_histogram, plot_tree -except ImportError: - pass -try: - from .dask import DaskLGBMClassifier, DaskLGBMRanker, DaskLGBMRegressor -except ImportError: - pass - +from .plotting import create_tree_digraph, plot_importance, plot_metric, plot_split_value_histogram, plot_tree +from .sklearn import LGBMClassifier, LGBMModel, LGBMRanker, LGBMRegressor _version_path = Path(__file__).absolute().parent / "VERSION.txt" if _version_path.is_file():