title: AttributeError: /home/hp/anaconda3/lib/libxgboost.so: undefined symbol: XGDMatrixSetDenseInfo
body: <p>I have installed <code>XGBoost</code> with <code>pip3</code>.</p>
  <p>While trying to run this line:</p>
  <pre><code>clf = GridSearchCV(estimator=xgb.XGBClassifier(use_label_encoder =False), param_grid=params, scoring = 'accuracy', cv=20).fit(data_train, label_train)
  </code></pre>
  <p>I get this error :</p>
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-90-718a4a11a2ba&gt; in &lt;module&gt;
        4     startTime = time.time()
        5 
  ----&gt; 6     clf = GridSearchCV(estimator=xgb.XGBClassifier(use_label_encoder =False), param_grid=params, scoring = 'accuracy', cv=20).fit(data_train, label_train)
        7     print(clf.best_estimator_)
        8     print('--------------------------------------------------')
  
  ~/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
       61             extra_args = len(args) - len(all_args)
       62             if extra_args &lt;= 0:
  ---&gt; 63                 return f(*args, **kwargs)
       64 
       65             # extra_args &gt; 0
  
  ~/anaconda3/lib/python3.8/site-packages/sklearn/model_selection/_search.py in fit(self, X, y, groups, **fit_params)
      878             refit_start_time = time.time()
      879             if y is not None:
  --&gt; 880                 self.best_estimator_.fit(X, y, **fit_params)
      881             else:
      882                 self.best_estimator_.fit(X, **fit_params)
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/core.py in inner_f(*args, **kwargs)
      420         for k, arg in zip(sig.parameters, args):
      421             kwargs[k] = arg
  --&gt; 422         return f(**kwargs)
      423 
      424     return inner_f
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/sklearn.py in fit(self, X, y, sample_weight, base_margin, eval_set, eval_metric, early_stopping_rounds, verbose, xgb_model, sample_weight_eval_set, feature_weights, callbacks)
      901         self.n_features_in_ = self._features_count
      902 
  --&gt; 903         train_dmatrix, evals = self._wrap_evaluation_matrices(
      904             X, y, group=None, sample_weight=sample_weight, base_margin=base_margin,
      905             feature_weights=feature_weights,
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/sklearn.py in _wrap_evaluation_matrices(self, X, y, group, sample_weight, base_margin, feature_weights, eval_set, sample_weight_eval_set, eval_group, label_transform)
      263 
      264         y = label_transform(y)
  --&gt; 265         train_dmatrix = DMatrix(data=X, label=y, weight=sample_weight,
      266                                 base_margin=base_margin,
      267                                 missing=self.missing, nthread=self.n_jobs)
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/core.py in __init__(self, data, label, weight, base_margin, missing, silent, feature_names, feature_types, nthread, enable_categorical)
      507         self.handle = handle
      508 
  --&gt; 509         self.set_info(label=label, weight=weight, base_margin=base_margin)
      510 
      511         self.feature_names = feature_names
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/core.py in inner_f(*args, **kwargs)
      420         for k, arg in zip(sig.parameters, args):
      421             kwargs[k] = arg
  --&gt; 422         return f(**kwargs)
      423 
      424     return inner_f
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/core.py in set_info(self, label, weight, base_margin, group, label_lower_bound, label_upper_bound, feature_names, feature_types, feature_weights)
      528         '''Set meta info for DMatrix.'''
      529         if label is not None:
  --&gt; 530             self.set_label(label)
      531         if weight is not None:
      532             self.set_weight(weight)
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/core.py in set_label(self, label)
      657         &quot;&quot;&quot;
      658         from .data import dispatch_meta_backend
  --&gt; 659         dispatch_meta_backend(self, label, 'label', 'float')
      660 
      661     def set_weight(self, weight):
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/data.py in dispatch_meta_backend(matrix, data, name, dtype)
      674         data = data.values.astype('float')
      675         assert len(data.shape) == 1 or data.shape[1] == 0 or data.shape[1] == 1
  --&gt; 676         _meta_from_numpy(data, name, dtype, handle)
      677         return
      678     if _is_dlpack(data):
  
  ~/anaconda3/lib/python3.8/site-packages/xgboost/data.py in _meta_from_numpy(data, field, dtype, handle)
      598     ptr = interface['data'][0]
      599     ptr = ctypes.c_void_p(ptr)
  --&gt; 600     _check_call(_LIB.XGDMatrixSetDenseInfo(
      601         handle,
      602         c_str(field),
  
  ~/anaconda3/lib/python3.8/ctypes/__init__.py in __getattr__(self, name)
      392         if name.startswith('__') and name.endswith('__'):
      393             raise AttributeError(name)
  --&gt; 394         func = self.__getitem__(name)
      395         setattr(self, name, func)
      396         return func
  
  ~/anaconda3/lib/python3.8/ctypes/__init__.py in __getitem__(self, name_or_ordinal)
      397 
      398     def __getitem__(self, name_or_ordinal):
  --&gt; 399         func = self._FuncPtr((name_or_ordinal, self))
      400         if not isinstance(name_or_ordinal, int):
      401             func.__name__ = name_or_ordinal
  
  AttributeError: /home/hp/anaconda3/lib/libxgboost.so: undefined symbol: XGDMatrixSetDenseInfo
  </code></pre>