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.2 installation error in python 3.12 #2520

Closed
115dkk opened this issue Oct 31, 2023 · 10 comments
Closed

catboost 1.2.2 installation error in python 3.12 #2520

115dkk opened this issue Oct 31, 2023 · 10 comments

Comments

@115dkk
Copy link

115dkk commented Oct 31, 2023

Problem

Not available for python 3.12 due to an installation error. (Available on Anaconda)


Using cached catboost-1.2.2.tar.gz (60.1 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [119 lines of output]
Collecting setuptools>=64.0
Using cached setuptools-68.2.2-py3-none-any.whl.metadata (6.3 kB)
Collecting wheel
Using cached wheel-0.41.3-py3-none-any.whl.metadata (2.2 kB)
Collecting jupyterlab
Using cached jupyterlab-4.0.7-py3-none-any.whl.metadata (15 kB)
Collecting conan<=1.59,>=1.57
Using cached conan-1.59.0.tar.gz (780 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting async-lru>=1.0.0 (from jupyterlab)
Using cached async_lru-2.0.4-py3-none-any.whl.metadata (4.5 kB)
Collecting ipykernel (from jupyterlab)
Using cached ipykernel-6.26.0-py3-none-any.whl.metadata (6.3 kB)
Collecting jinja2>=3.0.3 (from jupyterlab)
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting jupyter-core (from jupyterlab)
Using cached jupyter_core-5.5.0-py3-none-any.whl.metadata (3.4 kB)
Collecting jupyter-lsp>=2.0.0 (from jupyterlab)
Using cached jupyter_lsp-2.2.0-py3-none-any.whl.metadata (1.8 kB)
Collecting jupyter-server<3,>=2.4.0 (from jupyterlab)
Using cached jupyter_server-2.9.1-py3-none-any.whl.metadata (8.6 kB)
Collecting jupyterlab-server<3,>=2.19.0 (from jupyterlab)
Using cached jupyterlab_server-2.25.0-py3-none-any.whl.metadata (5.9 kB)
Collecting notebook-shim>=0.2 (from jupyterlab)
Using cached notebook_shim-0.2.3-py3-none-any.whl (13 kB)
Collecting packaging (from jupyterlab)
Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Collecting tornado>=6.2.0 (from jupyterlab)
Using cached tornado-6.3.3-cp38-abi3-win_amd64.whl.metadata (2.6 kB)
Collecting traitlets (from jupyterlab)
Using cached traitlets-5.13.0-py3-none-any.whl.metadata (10 kB)
Collecting requests<3.0.0,>=2.25 (from conan<=1.59,>=1.57)
Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting urllib3<1.27,>=1.26.6 (from conan<=1.59,>=1.57)
Using cached urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB)
Collecting colorama<0.5.0,>=0.3.3 (from conan<=1.59,>=1.57)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting PyYAML<=6.0,>=3.11 (from conan<=1.59,>=1.57)
Using cached PyYAML-6.0.tar.gz (124 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

[54 lines of output]
running egg_info
writing lib\PyYAML.egg-info\PKG-INFO
writing dependency_links to lib\PyYAML.egg-info\dependency_links.txt
writing top-level names to lib\PyYAML.egg-info\top_level.txt
Traceback (most recent call last):
File "C:\Python\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Python\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_build_requires
self.run_setup()
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "", line 288, in
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools_init
.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools_distutils\core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 318, in run
self.find_sources()
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 326, in find_sources
mm.run()
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 548, in run
self.add_defaults()
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 586, in add_defaults
sdist.add_defaults(self)
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools\command\sdist.py", line 113, in add_defaults
super().add_defaults()
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools_distutils\command\sdist.py", line 251, in add_defaults
self._add_defaults_ext()
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools_distutils\command\sdist.py", line 336, in _add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 204, in get_source_files
File "C:\Users\user\AppData\Local\Temp\pip-build-env-iejyj9pe\overlay\Lib\site-packages\setuptools_distutils\cmd.py", line 107, in getattr
raise AttributeError(attr)
AttributeError: cython_sources
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Getting requirements to build 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.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies 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.


This cannot be bypassed via the --no-deps option, and is also prevented by downloading and installing the master branch directly.

Is there any way to work around this dependency?

catboost version

1.2.2

Operating System

Windows 10

CPU

AMD 5600X

GPU

GTX 1050Ti

@andrey-khropov
Copy link
Member

This seems to be a known issue in PyYAML. Can you try to manually update PyYAML version to >= 6.0.1 before installing CatBoost?

@Rubinjo
Copy link

Rubinjo commented Nov 3, 2023

I have the same issue and tried installing PyYAML before Catboost, which makes the install crash on PyYAML rather than Catboost itself. So, it emphasizes that it should be a problem with PyYAML rather than Catboost.

@andrey-khropov
Copy link
Member

I have the same issue and tried installing PyYAML before Catboost, which makes the install crash on PyYAML rather than Catboost itself. So, it emphasizes that it should be a problem with PyYAML rather than Catboost.

Does forcing PyYAML version to >= 6.0.1 help?

@115dkk
Copy link
Author

115dkk commented Nov 7, 2023

I have the same issue and tried installing PyYAML before Catboost, which makes the install crash on PyYAML rather than Catboost itself. So, it emphasizes that it should be a problem with PyYAML rather than Catboost.

Does forcing PyYAML version to >= 6.0.1 help?

I've tried a few things, including ignoring dependencies, but unfortunately I've never been able to get it to work as it 'must' downgrade when installing catboost. If you know of any other ways to do this, could you please explain?

In other words, it's catboost's habit of downgrading PyYAML to the problematic 6.0.0 that's the problem. If you can come up with a way to fix that, I'll try again.

@tanyageorgieva
Copy link

tanyageorgieva commented Nov 8, 2023

I also hit this problem when bumped catboost to 1.2.2 in Python3.11.6, catboost is installing an older version of PyYAML which has the mentioned problem with Cython.

@115dkk
Copy link
Author

115dkk commented Nov 13, 2023

This seems to be a known issue in PyYAML. Can you try to manually update PyYAML version to >= 6.0.1 before installing CatBoost?

  1. manually update PyYAML = doesn't work as you will be forced to downgrade anyway upon installation.
  2. ignore dependencies option = doesn't work, all dependencies will be forced to be installed 'unconditionally'.
  3. install directly from master branch = doesn't work either.
  4. install a previous version = I don't know if I'm missing something, but I can't find any version above 1.0 installs bypassing those dependencies.

I think we need to come up with something different.

I'm afraid I don't know how, but surely there must be a way to adjust the dependency directly? If anyone knows about this, please leave a comment and I'll try to fix it myself.

@RubTalha
Copy link

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

@andrey-khropov
Copy link
Member

andrey-khropov commented Nov 16, 2023

The core of the issue has been that conan build dependency versions range (1.57.0 - 1.59.0) depended on old versions of PyYAML before the fix of yaml/pyyaml#601. conan made the release 1.60.2 that fixed this, but python 3.12 support had been broken in conan 1.x until the release 1.62.0 which had been published only on November 14th. In 4bc7541 I've changed minimal conan dependency to this version and checked that this issue is resolved now.

Upd: obviously this means that you can't install catboost 1.2.2 with python 3.12, you'll need either to build from GitHub master from commit 4bc7541 or later or wait for release 1.2.3 which I expect to be published in a matter of days.

@matthewferler
Copy link

Does anyone have an update on this? I love catboost and I love Python. I'd like to upgrade to Python 3.12 but catboost is a critical piece of software so I can't due to this issue.

@RNarayan73
Copy link

Upd: obviously this means that you can't install catboost 1.2.2 with python 3.12, you'll need either to build from GitHub master from commit 4bc7541 or later or wait for release 1.2.3 which I expect to be published in a matter of days.

@andrey-khropov do you have an ETA for the release 1.2.3 with Python 3.12 support?

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

7 participants