Back to Catboost

Build Python package from source on Linux and macOS using Ya Make

catboost/docs/en/installation/python-installation-method-build-from-source-linux-macos-using-ya-make.md

1.2.102.3 KB
Original Source

Build Python package from source on Linux and macOS using Ya Make

{% if audience == "internal" %}

{% include internal-note__use-outside-arcadia %}

{% endif %}

{% note info %}

{% include ya-make-to-cmake-switch %}

This page describes building using Ya Make. For building using CMake see documentation here.

{% endnote %}

Dependencies and requirements {#dependencies-and-particularities}

  1. Setup environment for ya make build

  2. {% include installation-packages-for-installation %}

  • python3
  • python3-dev
  • numpy
  • pandas

{% include installation-nvidia-driver-reqs %}

Building steps {#building-steps}

To build the {{ python-package }} from source on Linux and macOS:

  1. Clone the repository:

    no-highlight
    {{ installation--git-clone }}
    
  2. Open the catboost/catboost/python-package/catboost directory from the local copy of the {{ product }} repository.

  3. {% include installation-compile-the-library %}

    {% include installation-installation-example %}

    {% note info %}

    The required version of Xcode for building on macOS is specified on the NVIDIA site when downloading the CUDA toolkit.

    {% endnote %}

  4. Add the current directory to PYTHONPATH:

    cd ../; export PYTHONPATH=$PYTHONPATH:$(pwd)
    

Troubleshooting {#troubleshooting}

Error typeMessage formatTroubleshooting tips
AttributeErrortype object '_catboost.<something>' has no attribute 'reduce_cython'
<b>Example:</b>
AttributeError: type object '_catboost._FloatArrayWrapper' has no attribute 'reduce_cython'
AttributeError: type object '_catboost.Py_ITypedSequencePtr' has no attribute 'reduce_cython'

| Install or update the following packages:

  • numpy
  • pandas