Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catboost 1.2 installation error #2469

Open
monkey0head opened this issue Aug 4, 2023 · 15 comments
Open

catboost 1.2 installation error #2469

monkey0head opened this issue Aug 4, 2023 · 15 comments

Comments

@monkey0head
Copy link
Contributor

Problem: Catboost 1.2 installation fails with

Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES
Development Development.Module Development.Embed)

I am trying to install catboost 1.2 inside virtual environment with python 3.9.7 created with pyenv. It fails with an error above. the 1.11 works. What is the problem and how can I fix it?

catboost version: 1.12
Operating System: mac os Monterey 12.6.3

Installation log:

pip install catboost    
Collecting catboost
  Using cached catboost-1.2.tar.gz (95.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting graphviz (from catboost)
  Using cached graphviz-0.20.1-py3-none-any.whl (47 kB)
Collecting matplotlib (from catboost)
  Using cached matplotlib-3.7.2-cp39-cp39-macosx_10_12_x86_64.whl (7.4 MB)
Collecting numpy>=1.16.0 (from catboost)
  Using cached numpy-1.25.2-cp39-cp39-macosx_10_9_x86_64.whl (20.8 MB)
Collecting pandas>=0.24 (from catboost)
  Using cached pandas-2.0.3-cp39-cp39-macosx_10_9_x86_64.whl (11.8 MB)
Collecting scipy (from catboost)
  Using cached scipy-1.11.1-cp39-cp39-macosx_10_9_x86_64.whl (37.2 MB)
Collecting plotly (from catboost)
  Using cached plotly-5.15.0-py2.py3-none-any.whl (15.5 MB)
Collecting six (from catboost)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting python-dateutil>=2.8.2 (from pandas>=0.24->catboost)
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytz>=2020.1 (from pandas>=0.24->catboost)
  Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB)
Collecting tzdata>=2022.1 (from pandas>=0.24->catboost)
  Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)
Collecting contourpy>=1.0.1 (from matplotlib->catboost)
  Using cached contourpy-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl (243 kB)
Collecting cycler>=0.10 (from matplotlib->catboost)
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting fonttools>=4.22.0 (from matplotlib->catboost)
  Using cached fonttools-4.42.0-cp39-cp39-macosx_10_9_x86_64.whl (2.2 MB)
Collecting kiwisolver>=1.0.1 (from matplotlib->catboost)
  Using cached kiwisolver-1.4.4-cp39-cp39-macosx_10_9_x86_64.whl (65 kB)
Collecting packaging>=20.0 (from matplotlib->catboost)
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting pillow>=6.2.0 (from matplotlib->catboost)
  Using cached Pillow-10.0.0-cp39-cp39-macosx_10_10_x86_64.whl (3.4 MB)
Collecting pyparsing<3.1,>=2.3.1 (from matplotlib->catboost)
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting importlib-resources>=3.2.0 (from matplotlib->catboost)
  Using cached importlib_resources-6.0.0-py3-none-any.whl (31 kB)
Collecting tenacity>=6.2.0 (from plotly->catboost)
  Using cached tenacity-8.2.2-py3-none-any.whl (24 kB)
Collecting zipp>=3.1.0 (from importlib-resources>=3.2.0->matplotlib->catboost)
  Using cached zipp-3.16.2-py3-none-any.whl (7.2 kB)
Building wheels for collected packages: catboost
  Building wheel for catboost (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for catboost (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [209 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.15-x86_64-cpython-39
      creating build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/monoforest.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/plot_helpers.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/metrics.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/version.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/text_processing.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/datasets.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/__init__.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/core.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/utils.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      copying catboost/dev_utils.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost
      creating build/lib.macosx-10.15-x86_64-cpython-39/catboost/widget
      copying catboost/widget/__init__.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/widget
      copying catboost/widget/metrics_plotter.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/widget
      copying catboost/widget/ipythonwidget.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/widget
      copying catboost/widget/callbacks.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/widget
      creating build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/catboost_evaluation.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/_fold_model.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/_readers.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/log_config.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/_splitter.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/__init__.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/execution_case.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/_fold_storage.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/factor_utils.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/utils.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/evaluation_result.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      copying catboost/eval/_fold_models_handler.py -> build/lib.macosx-10.15-x86_64-cpython-39/catboost/eval
      running build_ext
      Buildling _catboost with cmake and ninja
      target_platform=darwin-x86_64. Building targets _catboost with PIC
      Running "cmake /private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/catboost_all_src -B /private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/build/temp.macosx-10.15-x86_64-cpython-39 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/catboost_all_src/build/toolchains/clang.toolchain --log-level=VERBOSE -DCMAKE_POSITION_INDEPENDENT_CODE=On -DCATBOOST_COMPONENTS=python-package -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DHAVE_CUDA=no -DPython3_ROOT_DIR=/PATH/venv"
      -- The C compiler identification is AppleClang 12.0.0.12000032
      -- The CXX compiler identification is AppleClang 12.0.0.12000032
      -- The ASM compiler identification is Clang with GNU-like command-line
      -- Found assembler: /Library/Developer/CommandLineTools/usr/bin/clang
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/clang - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/clang++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python3: /PATH/venv/bin/python3.9 (found version "3.9.7") found components: Interpreter
      -- CMAKE_C_FLAGS = "   -fexceptions   -fno-common   -fcolor-diagnostics   -faligned-allocation   -fdebug-default-version=4   -ffunction-sections   -fdata-sections   -Wall   -Wextra   -Wno-parentheses   -Wno-implicit-const-int-float-conversion   -Wno-unknown-warning-option   -pipe   -D_THREAD_SAFE   -D_PTHREADS   -D_REENTRANT   -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES   -D_LARGEFILE_SOURCE   -D__STDC_CONSTANT_MACROS   -D__STDC_FORMAT_MACROS   -D__LONG_LONG_SUPPORTED  -DLIBCXX_BUILDING_LIBCXXRT -D_FILE_OFFSET_BITS=64 -m64    -msse2     -msse3     -mssse3         -msse4.1       -msse4.2       -mpopcnt      -mcx16     -DSSE_ENABLED=1     -DSSE3_ENABLED=1     -DSSSE3_ENABLED=1         -DSSE41_ENABLED=1       -DSSE42_ENABLED=1       -DPOPCNT_ENABLED=1      -DCX16_ENABLED=1"
      -- CMAKE_CXX_FLAGS = "   -fexceptions   -fno-common   -fcolor-diagnostics   -faligned-allocation   -fdebug-default-version=4   -ffunction-sections   -fdata-sections   -Wall   -Wextra   -Wno-parentheses   -Wno-implicit-const-int-float-conversion   -Wno-unknown-warning-option   -pipe   -D_THREAD_SAFE   -D_PTHREADS   -D_REENTRANT   -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES   -D_LARGEFILE_SOURCE   -D__STDC_CONSTANT_MACROS   -D__STDC_FORMAT_MACROS   -D__LONG_LONG_SUPPORTED  -DLIBCXX_BUILDING_LIBCXXRT -D_FILE_OFFSET_BITS=64 -m64    -msse2     -msse3     -mssse3         -msse4.1       -msse4.2       -mpopcnt      -mcx16   -Woverloaded-virtual   -Wimport-preprocessor-directive-pedantic   -Wno-undefined-var-template   -Wno-return-std-move   -Wno-defaulted-function-deleted   -Wno-pessimizing-move   -Wno-deprecated-anon-enum-enum-conversion   -Wno-deprecated-enum-enum-conversion   -Wno-deprecated-enum-float-conversion   -Wno-ambiguous-reversed-operator   -Wno-deprecated-volatile      -DSSE_ENABLED=1     -DSSE3_ENABLED=1     -DSSSE3_ENABLED=1         -DSSE41_ENABLED=1       -DSSE42_ENABLED=1       -DPOPCNT_ENABLED=1      -DCX16_ENABLED=1"
      -- Conan: checking conan executable
      -- Conan: Found program /private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/bin/conan
      -- Conan: Version found Conan version 1.59.0
      -- Conan executing: /private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/bin/conan install /private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/catboost_all_src --remote conancenter --install-folder /private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/build/temp.macosx-10.15-x86_64-cpython-39 --build missing --env CONAN_CMAKE_GENERATOR=Ninja --settings build_type=Release --settings compiler=apple-clang --settings compiler.version=12.0 --settings compiler.libcxx=libc++ --settings compiler.cppstd=20 --conf tools.cmake.cmaketoolchain:generator=Ninja
      Configuration:
      [settings]
      arch=x86_64
      arch_build=x86_64
      build_type=Release
      compiler=apple-clang
      compiler.cppstd=20
      compiler.libcxx=libc++
      compiler.version=12.0
      os=Macos
      os_build=Macos
      [options]
      [build_requires]
      [env]
      CONAN_CMAKE_GENERATOR=Ninja
      [conf]
      tools.cmake.cmaketoolchain:generator=Ninja
      
      conanfile.txt: Installing package
      Requirements
          libiconv/1.15 from 'conancenter' - Cache
          openssl/1.1.1s from 'conancenter' - Cache
          zlib/1.2.13 from 'conancenter' - Cache
      Packages
          libiconv/1.15:ca6b19bf89270552244fca32806dded803132e76 - Cache
          openssl/1.1.1s:647afeb69d3b0a2d3d316e80b24d38c714cc6900 - Cache
          zlib/1.2.13:647afeb69d3b0a2d3d316e80b24d38c714cc6900 - Cache
      Build requirements
          bzip2/1.0.8 from 'conancenter' - Cache
          pcre/8.45 from 'conancenter' - Cache
          ragel/6.10 from 'conancenter' - Cache
          swig/4.0.2 from 'conancenter' - Cache
          yasm/1.3.0 from 'conancenter' - Cache
      Build requirements packages
          bzip2/1.0.8:75fe66fbfe61230e9fcbb361f13b6b3baa483e0a - Cache
          pcre/8.45:6b708b31085f36a04cd9dea85c6b67a06a563c31 - Cache
          ragel/6.10:801752c0480319b8e090188c566245a78e9abcf4 - Cache
          swig/4.0.2:099d7b9cd06e9bd11e92b9a2ddf3b29cd986fdcb - Cache
          yasm/1.3.0:801752c0480319b8e090188c566245a78e9abcf4 - Cache
      
      Installing (downloading, building) binaries...
      bzip2/1.0.8: Already installed!
      libiconv/1.15: Already installed!
      openssl/1.1.1s: Already installed!
      ragel/6.10: Already installed!
      ragel/6.10: Appending PATH environment variable: /Users/HOMEDIR/.conan/data/ragel/6.10/_/_/package/801752c0480319b8e090188c566245a78e9abcf4/bin
      yasm/1.3.0: Already installed!
      yasm/1.3.0: Appending PATH environment variable: /Users/HOMEDIR/.conan/data/yasm/1.3.0/_/_/package/801752c0480319b8e090188c566245a78e9abcf4/bin
      zlib/1.2.13: Already installed!
      pcre/8.45: Already installed!
      swig/4.0.2: Already installed!
      swig/4.0.2: Appending PATH environment variable: /Users/HOMEDIR/.conan/data/swig/4.0.2/_/_/package/099d7b9cd06e9bd11e92b9a2ddf3b29cd986fdcb/bin
      conanfile.txt: Applying build-requirement: ragel/6.10
      conanfile.txt: Applying build-requirement: swig/4.0.2
      conanfile.txt: Applying build-requirement: yasm/1.3.0
      conanfile.txt: Applying build-requirement: pcre/8.45
      conanfile.txt: Applying build-requirement: bzip2/1.0.8
      conanfile.txt: Generator cmake_find_package created Findragel.cmake
      conanfile.txt: Generator cmake_find_package created FindSWIG.cmake
      conanfile.txt: Generator cmake_find_package created Findyasm.cmake
      conanfile.txt: Generator cmake_find_package created FindIconv.cmake
      conanfile.txt: Generator cmake_find_package created FindOpenSSL.cmake
      conanfile.txt: Generator cmake_find_package created FindPCRE.cmake
      conanfile.txt: Generator cmake_find_package created FindBZip2.cmake
      conanfile.txt: Generator cmake_find_package created FindZLIB.cmake
      conanfile.txt: Generator cmake_paths created conan_paths.cmake
      conanfile.txt: Generator txt created conanbuildinfo.txt
      conanfile.txt: Aggregating env generators
      conanfile.txt: Generated conaninfo.txt
      conanfile.txt: Generated graphinfo
      conanfile.txt imports(): Copied 434 '.i' files
      conanfile.txt imports(): Copied 273 '.swg' files
      conanfile.txt imports(): Copied 6 files
      conanfile.txt imports(): Copied 2 '.ml' files: swig.ml, swigp4.ml
      conanfile.txt imports(): Copied 1 '.swig' file: Makefile.swig
      conanfile.txt imports(): Copied 1 '.pl' file: Makefile.pl
      conanfile.txt imports(): Copied 1 '.scm' file: common.scm
      conanfile.txt imports(): Copied 1 '.mli' file: swig.mli
      conanfile.txt imports(): Copied 1 '.rb' file: extconf.rb
      conanfile.txt imports(): Copied 1 '.h' file: noembed.h
      conanfile.txt imports(): Copied 1 '.hpp' file: octheaders.hpp
      CMake Error at /usr/local/Cellar/cmake/3.22.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
        Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES
        Development Development.Module Development.Embed)
      Call Stack (most recent call first):
        /usr/local/Cellar/cmake/3.22.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
        /usr/local/Cellar/cmake/3.22.2/share/cmake/Modules/FindPython/Support.cmake:3166 (find_package_handle_standard_args)
        /usr/local/Cellar/cmake/3.22.2/share/cmake/Modules/FindPython3.cmake:490 (include)
        catboost/python-package/catboost/CMakeLists.darwin-x86_64.txt:9 (find_package)
        catboost/python-package/catboost/CMakeLists.txt:20 (include)
      
      
      -- Configuring incomplete, errors occurred!
      See also "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/build/temp.macosx-10.15-x86_64-cpython-39/CMakeFiles/CMakeOutput.log".
      See also "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/build/temp.macosx-10.15-x86_64-cpython-39/CMakeFiles/CMakeError.log".
      Traceback (most recent call last):
        File "/PATH/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/PATH/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/PATH/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 723, in <module>
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 389, in run
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 346, in run
          self.run_command("build")
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 324, in run
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-build-env-gm40wmn6/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 436, in run
        File "<string>", line 454, in build_with_cmake_and_ninja
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/catboost_all_src/build/build_native.py", line 517, in build
          cmd_runner.run(cmake_cmd, env=build_environ)
        File "/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/catboost_all_src/build/build_native.py", line 164, in run
          subprocess.run(cmd, check=True, **subprocess_run_kwargs)
        File "/Users/HOMEDIR/.pyenv/versions/3.9.7/lib/python3.9/subprocess.py", line 528, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/catboost_all_src', '-B', '/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/build/temp.macosx-10.15-x86_64-cpython-39', '-G', 'Ninja', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_TOOLCHAIN_FILE=/private/var/folders/4d/gwypvjjd4wb29y2091pfpd3wjnzltv/T/pip-install-xp79gpk8/catboost_b4f3373bd5da46fc9e0483a22acacc17/catboost_all_src/build/toolchains/clang.toolchain', '--log-level=VERBOSE', '-DCMAKE_POSITION_INDEPENDENT_CODE=On', '-DCATBOOST_COMPONENTS=python-package', '-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0', '-DHAVE_CUDA=no', '-DPython3_ROOT_DIR=/PATH/venv']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for catboost
Failed to build catboost
ERROR: Could not build wheels for catboost, which is required to install pyproject.toml-based projects
@andrey-khropov
Copy link
Member

Can you give more details about how you set up the virtual environment and install python from pyenv?
Do you explicitly try to build CatBoost python package from source or just try to install pip install catboost ?

@monkey0head
Copy link
Contributor Author

pyenv install -v 3.9.7
~/.pyenv/versions/3.9.7/bin/python3.9 -m venv env39
source env39/bin/activate
pip install --upgrade pip wheel
pip install catboost

@AraceliAL
Copy link

AraceliAL commented Aug 10, 2023

Hello! I encounter the exact same issue!
python:3.9, and the environment is created with conda

@dsgibbons
Copy link

dsgibbons commented Aug 21, 2023

Same here, also in conda with Python 3.11.4 on a Mac x86_64

@d0plr
Copy link

d0plr commented Sep 1, 2023

Same error, trying to upgrade catboost to 1.2.1 with
pip install -U catboost

inside a virtual environment on macOS 10.15.7, using Python 3.10.13 from macport.
The virtualenv was set up with:
/opt/local/bin/python3.10 -mvenv venv

@tuomijal
Copy link

Same here using Python 3.8.16 running on MacOS 13.2 (22D49) with emulated x86_64 and virtualenv with python -m venv .env

@noircir
Copy link

noircir commented Oct 28, 2023

The same here:
Python 3.9.6
MacOS 13.3 Ventura
python3 -m venv venv
pip install catboost

Some more hardware info:

  • Model Name: MacBook Pro
  • Model Identifier: MacBookPro16,1
  • Processor Name: 6-Core Intel Core i7
  • Processor Speed: 2.6 GHz
  • Number of Processors: 1
  • Total Number of Cores: 6
  • L2 Cache (per Core): 256 KB
  • L3 Cache: 12 MB
  • Hyper-Threading Technology: Enabled
  • Memory: 16 GB
  • System Firmware Version: 1968.100.17.0.0 (iBridge: 20.16.4252.0.0,0)
  • OS Loader Version: 577~129

@RubTalha
Copy link

https://stackoverflow.com/questions/77490435/attributeerror-cython-sources/77491847#77491847

@andrey-khropov andrey-khropov self-assigned this Nov 24, 2023
@tsar1987
Copy link

tsar1987 commented Dec 3, 2023

Hello! I encounter the exact same issue!
python:3.11.3, and the environment is created with conda

@andrey-khropov
Copy link
Member

The same here: Python 3.9.6 MacOS 13.3 Ventura python3 -m venv venv pip install catboost
Model Identifier: MacBookPro16,1

i cannot reproduce it. I tried both standard python 3.9, homebrew python 3.9, pyenv python 3.9 - all of them install catboost using these commands without problems.

Although macOS version is 13.6 because earlier subversions of Ventura are no longer available on Apple website.

@andrey-khropov
Copy link
Member

Hello! I encounter the exact same issue! python:3.11.3, and the environment is created with conda

Can you describe how to reproduce this in maximum detais?

Your hardware configuration, macOS version, which conda version do you use.

I've tried on MacBookPro16,1 with macOS 13.6:

$ conda create -n venv python=3.11.3
$ conda activate venv
(venv) $ pip install --upgrade pip wheel
(venv) $ pip install catboost

Works without problems.

@PrimozGodec
Copy link

I just came around, so I don't know what exactly is the issue in the case of users who reported the error, but it may be this:
https://cibuildwheel.readthedocs.io/en/stable/faq/#what-to-provide

Generally speaking, because Pip 20.3 is required for the universal2 wheel, most packages should provide both x86_64 and one of universal2/arm64 wheels. When Pip 20.3+ is common on macOS, it might be possible to ship only the universal2 wheel.

Since catboost provides only a universal Macos wheel, it can cause issues to users using pip<20.3. A better practice is to provide also x86_64 wheels. Or to provide x86_64 and arm64 instead of universal.

@andrey-khropov
Copy link
Member

Since catboost provides only a universal Macos wheel, it can cause issues to users using pip<20.3.

Such old versions of pip should not be used. pip's support policy is that only the latest version is supported.

@PrimozGodec
Copy link

@andrey-khropov, I agree, this is a very old pip, but there are still cases around where people have old pip (for example, Python installed with brew). Here is a conversation from cibuildwheel on this: pypa/cibuildwheel#1333 (comment). It is already a year old, but there are still cases around. :)

I don't mean you need to change it (since users already survived a long time without the x86_64 wheel. My comment was more of an idea of what may be happening in this issue.

@andrey-khropov
Copy link
Member

This issue might be caused by python interpreters built with old macOS SDK that do not have proper platform tags so pip tries to build catboost from source instead (and this requires build environment setup)
The workaround is to specify SYSTEM_VERSION_COMPAT=0:

SYSTEM_VERSION_COMPAT=0 pip install catboost...

microsoft/onnxruntime#17166 (comment)
pypa/packaging#497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants