catboost: NameError: name 'PY3' is not defined

Hi!

I installed catboost on Python 3.6.3 within a Docker container (python:3.6 image). The installation was done through PyPI. The library version is 0.6.3

I can import catboost, but when I do:

model = catboost.CatBoostRegressor()

I obtain an error:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-16-e4bd7d18c439> in <module>()
----> 1 model = catboost.CatBoostRegressor()

/usr/local/lib/python3.6/site-packages/catboost/core.py in __init__(self, iterations, learning_rate, depth, l2_leaf_reg, model_size_reg, rsm, loss_function, border_count, feature_border_type, fold_permutation_block_size, od_pval, od_wait, od_type, nan_mode, counter_calc_method, leaf_estimation_iterations, leaf_estimation_method, thread_count, random_seed, use_best_model, verbose, logging_level, metric_period, ctr_leaf_count_limit, store_all_simple_ctr, max_ctr_complexity, has_time, one_hot_max_size, random_strength, name, ignored_features, train_dir, custom_metric, eval_metric, bagging_temperature, save_snapshot, snapshot_file, fold_len_multiplier, used_ram_limit, gpu_ram_part, allow_writing_files, approx_on_full_history, boosting_type, simple_ctr, combinations_ctr, per_feature_ctr, ctr_description, task_type, device_config, devices, bootstrap_type, max_depth, n_estimators, num_boost_round, num_trees, colsample_bylevel, random_state, reg_lambda, objective, eta, max_bin, **kwargs)
   1767             objective = None
   1768 
-> 1769         if isinstance(loss_function, str) and self._is_classification_loss(loss_function):
   1770             raise CatboostError("Invalid loss_function={}: for Regressor use RMSE, MAE, Quantile, LogLinQuantile, Poisson, MAPE, R2.".format(loss_function))
   1771         params = {}

_catboost.pyx in _catboost._CatBoostBase._is_classification_loss()

_catboost.pyx in _catboost.to_binary_str()

NameError: name 'PY3' is not defined

Same happens when I specify a loss function:

model = catboost.CatBoostRegressor(loss_function='MAPE')

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (4 by maintainers)

Commits related to this issue

Most upvoted comments

try to ‘pip install PY3’ worked for me

wow, on my home pc my previous answer doesn’t work

We fixed this bug in master, our plan is to ship new package version next tuesday.