Search code examples
pythonsql-server-mars

pyearth package installation issue (need to use MARS on Python 3.10)


I have a question regarding an old package to do a multivariate adaptive regression splines for my research. for me it's crucial to have an ability to define the max. number of knots to fit the data because the function is pretty complex.

Maybe some of you can suggest a similar Python package to do multivariate adaptive regression splines? I have lost a lot of time with tries. Any help is appreciated.

I have tried a lot of options to install it, but no success.

I have Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux

Here is the errors I have got during several tries.

  1. first attempt to install:

direct installation from a branch dev.

(.venv) fire@note-4:~/py_projects/proj$ pip install git+https://github.com/scikit-learn-contrib/[email protected]
Collecting git+https://github.com/scikit-learn-contrib/[email protected]
  Cloning https://github.com/scikit-learn-contrib/py-earth (to revision v0.2dev) to /tmp/pip-req-build-igm20quj
  Running command git clone --filter=blob:none --quiet https://github.com/scikit-learn-contrib/py-earth /tmp/pip-req-build-igm20quj
  Running command git checkout -b v0.2dev --track origin/v0.2dev
  Switched to a new branch 'v0.2dev'
  Branch 'v0.2dev' set up to track remote branch 'v0.2dev' from 'origin'.
  Resolved https://github.com/scikit-learn-contrib/py-earth to commit 400f84d435b7277124535c09ca32132c1d0eaa74
  Preparing metadata (setup.py) ... done
Requirement already satisfied: scipy>=0.16 in ./.venv/lib/python3.10/site-packages (from sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.11.3)
Requirement already satisfied: scikit-learn>=0.16 in ./.venv/lib/python3.10/site-packages (from sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.3.2)
Requirement already satisfied: six in ./.venv/lib/python3.10/site-packages (from sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.16.0)
Requirement already satisfied: numpy<2.0,>=1.17.3 in ./.venv/lib/python3.10/site-packages (from scikit-learn>=0.16->sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.26.1)
Requirement already satisfied: joblib>=1.1.1 in ./.venv/lib/python3.10/site-packages (from scikit-learn>=0.16->sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.3.2)
Requirement already satisfied: threadpoolctl>=2.0.0 in ./.venv/lib/python3.10/site-packages (from scikit-learn>=0.16->sklearn-contrib-py-earth==0.1.0+16.g400f84d) (3.2.0)
Building wheels for collected packages: sklearn-contrib-py-earth
  Building wheel for sklearn-contrib-py-earth (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [405 lines of output]
      ...proj/.venv/lib/python3.10/site-packages/setuptools/dist.py:472: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!
              ********************************************************************************
              Usage of dash-separated 'description-file' will not be supported in future
              versions. Please use the underscore name 'description_file' instead.
      
              By 2024-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
      
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************
      
      !!
        opt = self.warn_dash_deprecation(opt, section)
      proj../.venv/lib/python3.10/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!
      
              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************
      
      !!
        dist.fetch_build_eggs(dist.setup_requires)
      proj../.venv/lib/python3.10/site-packages/setuptools/dist.py:472: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!
      
              ********************************************************************************
              Usage of dash-separated 'description-file' will not be supported in future
              versions. Please use the underscore name 'description_file' instead.
      
              By 2024-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
      
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************
      
      !!
        opt = self.warn_dash_deprecation(opt, section)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/export.py -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/__init__.py -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/earth.py -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_version.py -> build/lib.linux-x86_64-cpython-310/pyearth
      creating build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/test_qr.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/test_util.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/test_export.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/test_earth.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/test_knot_search.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/__init__.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/testing_utils.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/test_pruning.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/test_forward.py -> build/lib.linux-x86_64-cpython-310/pyearth/test
      creating build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      copying pyearth/test/basis/test_linear.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      copying pyearth/test/basis/base.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      copying pyearth/test/basis/test_missingness.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      copying pyearth/test/basis/__init__.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      copying pyearth/test/basis/test_hinge.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      copying pyearth/test/basis/test_constant.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      copying pyearth/test/basis/test_basis.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      copying pyearth/test/basis/test_smoothed_hinge.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/basis
      creating build/lib.linux-x86_64-cpython-310/pyearth/test/record
      copying pyearth/test/record/test_pruning_pass.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/record
      copying pyearth/test/record/__init__.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/record
      copying pyearth/test/record/test_forward_pass.py -> build/lib.linux-x86_64-cpython-310/pyearth/test/record
      running egg_info
      creating sklearn_contrib_py_earth.egg-info
      writing sklearn_contrib_py_earth.egg-info/PKG-INFO
      writing dependency_links to sklearn_contrib_py_earth.egg-info/dependency_links.txt
      writing requirements to sklearn_contrib_py_earth.egg-info/requires.txt
      writing top-level names to sklearn_contrib_py_earth.egg-info/top_level.txt
      writing manifest file 'sklearn_contrib_py_earth.egg-info/SOURCES.txt'
      reading manifest file 'sklearn_contrib_py_earth.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching 'pyearth/test/pathological_data'
      adding license file 'LICENSE.txt'
      writing manifest file 'sklearn_contrib_py_earth.egg-info/SOURCES.txt'
      copying pyearth/_basis.c -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_basis.pxd -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_forward.c -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_forward.pxd -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_knot_search.c -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_knot_search.pxd -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_pruning.c -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_pruning.pxd -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_qr.c -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_qr.pxd -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_record.c -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_record.pxd -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_types.c -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_types.pxd -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_util.c -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/_util.pxd -> build/lib.linux-x86_64-cpython-310/pyearth
      copying pyearth/test/earth_linvars_regress.txt -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/earth_regress.txt -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/earth_regress_missing_data.txt -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/earth_regress_smooth.txt -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/forward_regress.txt -> build/lib.linux-x86_64-cpython-310/pyearth/test
      copying pyearth/test/test_data.csv -> build/lib.linux-x86_64-cpython-310/pyearth/test
      UPDATING build/lib.linux-x86_64-cpython-310/pyearth/_version.py
      set build/lib.linux-x86_64-cpython-310/pyearth/_version.py to '0.1.0+16.g400f84d'
      running build_ext
      building 'pyearth._util' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/pyearth
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Iproj../.venv/lib/python3.10/site-packages/numpy/core/include -Iproj../.venv/include -I/usr/include/python3.10 -c pyearth/_util.c -o build/temp.linux-x86_64-cpython-310/pyearth/_util.o
      In file included from proj../.venv/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929,
                       from proj../.venv/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                       from proj../.venv/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                       from pyearth/_util.c:625:
      proj../.venv/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
         17 | #warning "Using deprecated NumPy API, disable it with " \
            |  ^~~~~~~
      pyearth/_util.c: In function ‘__Pyx_ParseOptionalKeywords’:
      pyearth/_util.c:7935:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7935 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7935:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       7935 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
        580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            |                                             ^~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7935:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7935 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7935:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7935 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7935:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       7935 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
        580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            |                                             ^~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7935:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7935 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7951:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7951 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7951:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       7951 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
        580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            |                                             ^~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7951:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7951 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7951:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7951 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.10/unicodeobject.h:1046,
                       from /usr/include/python3.10/Python.h:83,
                       from pyearth/_util.c:24:
      /usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      pyearth/_util.c:7951:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       7951 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
...
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for sklearn-contrib-py-earth
  Running setup.py clean for sklearn-contrib-py-earth
Failed to build sklearn-contrib-py-earth
ERROR: Could not build wheels for sklearn-contrib-py-earth, which is required to install pyproject.toml-based projects
  1. I have read a hack https://github.com/scikit-learn-contrib/py-earth/issues/221 on how to use this package at python3.10, did everything like pgr_123 said: Here is what I have in this case:
 python setup.py build_ext --inplace --cythonize
Traceback (most recent call last):
  File "/home/fire/py_projects/MARS_pyearth/py-earth/setup.py", line 165, in <module>
    setup_package()
  File "/home/fire/py_projects/MARS_pyearth/py-earth/setup.py", line 145, in setup_package
    from Cython.Distutils import build_ext
ModuleNotFoundError: No module named 'Cython'
(.venv) fire@note-4:~/py_projects/MARS_pyearth/py-earth$ pip install cython
Collecting cython
  Downloading Cython-3.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)
Downloading Cython-3.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 MB 11.8 MB/s eta 0:00:00
Installing collected packages: cython
Successfully installed cython-3.0.6
(.venv) fire@note-4:~/py_projects/MARS_pyearth/py-earth$ python setup.py build_ext --inplace --cythonize
Compiling pyearth/_util.pyx because it changed.
Compiling pyearth/_basis.pyx because it changed.
Compiling pyearth/_record.pyx because it changed.
Compiling pyearth/_pruning.pyx because it changed.
Compiling pyearth/_forward.pyx because it changed.
Compiling pyearth/_knot_search.pyx because it changed.
Compiling pyearth/_qr.pyx because it changed.
Compiling pyearth/_types.pyx because it changed.
[1/8] Cythonizing pyearth/_basis.pyx
/home/fire/py_projects/MARS_pyearth/.venv/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/fire/py_projects/MARS_pyearth/py-earth/pyearth/_basis.pxd
  tree = Parsing.p_module(s, pxd, full_module_name)

Error compiling Cython file:
------------------------------------------------------------
...
from cpython cimport bool
cimport numpy as cnp
from _types cimport FLOAT_t, INT_t, INDEX_t, BOOL_t
^
------------------------------------------------------------

pyearth/_basis.pxd:3:0: '_types.pxd' not found

...

pyearth/_basis.pyx:184:48: Invalid type.
Traceback (most recent call last):
  File "/home/fire/py_projects/MARS_pyearth/py-earth/setup.py", line 165, in <module>
    setup_package()
  File "/home/fire/py_projects/MARS_pyearth/py-earth/setup.py", line 161, in setup_package
    setup_args['ext_modules'] = get_ext_modules()
  File "/home/fire/py_projects/MARS_pyearth/py-earth/setup.py", line 22, in get_ext_modules
    ext_modules = cythonize(
  File "/home/fire/py_projects/MARS_pyearth/.venv/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
    cythonize_one(*args)
  File "/home/fire/py_projects/MARS_pyearth/.venv/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pyearth/_basis.pyx

it seems in this case something is wrong with Cython - so I can't build required files fro the installation... What to do?

  1. tried to use in Colab, thought that maybe something was wrong with my environment - also an issue:

how to install pyearth in google colab?

Collecting git+https://github.com/scikit-learn-contrib/[email protected]
  Cloning https://github.com/scikit-learn-contrib/py-earth (to revision v0.2dev) to /tmp/pip-req-build-1a159lyh
  Running command git clone --filter=blob:none --quiet https://github.com/scikit-learn-contrib/py-earth /tmp/pip-req-build-1a159lyh
  Running command git checkout -b v0.2dev --track origin/v0.2dev
  Switched to a new branch 'v0.2dev'
  Branch 'v0.2dev' set up to track remote branch 'v0.2dev' from 'origin'.
  Resolved https://github.com/scikit-learn-contrib/py-earth to commit 400f84d435b7277124535c09ca32132c1d0eaa74
  Preparing metadata (setup.py) ... done
Requirement already satisfied: scipy>=0.16 in /usr/local/lib/python3.10/dist-packages (from sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.11.3)
Requirement already satisfied: scikit-learn>=0.16 in /usr/local/lib/python3.10/dist-packages (from sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.2.2)
Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.16.0)
Requirement already satisfied: numpy>=1.17.3 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.16->sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.23.5)
Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.16->sklearn-contrib-py-earth==0.1.0+16.g400f84d) (1.3.2)
Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.16->sklearn-contrib-py-earth==0.1.0+16.g400f84d) (3.2.0)
Building wheels for collected packages: sklearn-contrib-py-earth
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for sklearn-contrib-py-earth (setup.py) ... error
  ERROR: Failed building wheel for sklearn-contrib-py-earth
  Running setup.py clean for sklearn-contrib-py-earth
Failed to build sklearn-contrib-py-earth
ERROR: Could not build wheels for sklearn-contrib-py-earth, which is required to install pyproject.toml-based projects

Solution

  • maybe it will be useful for someone.

    After some time of experiments -> solution was found at least to try to work with that package..

    • install python 3.10.(I used 3.10.6) to a isolated env..
    • use script from here: https://github.com/scikit-learn-contrib/py-earth/issues/221 and put precompiled files into dist-packages folder of your virtual env..
    • install numpy and scipy with specified versions: pip3 install numpy==1.21.5 & pip3 install scipy==1.10.1
    • try how it works.

    My result for modelled data: enter image description here

    note: if you use pandas - use older version that 2.0.. I have used pandas 1.5.3 - so it works with mentioned numpy==1.21.5 like it should.