无法使用python 3.11.0安装scikit learn


I am using below setup
poetry: 1.2.2
pyenv: 2.3.5-3-g0726e02e
python: 3.11.0
scikit-learn: 1.1.2
I am trying to install scikit-learn using command:
**poetry add scikit-learn **
But I am getting error as below:
Preparing metadata (pyproject.toml): still running...
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [273 lines of output]
Partial import of sklearn during the build process.
setup.py:128: DeprecationWarning:

`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
....
....
....
self.finalize_unix()
File "/tmp/pip-build-env-go8f9tm1/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 498, in finalize_unix
self.select_scheme("posix_prefix")
File "/tmp/pip-build-env-go8f9tm1/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 528, in select_scheme
return self._select_scheme(resolved)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-go8f9tm1/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 537, in _select_scheme
setattr(self, attrname, scheme[key])
~~~~~~^^^^^
KeyError: 'headers'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
what I am missing?


正如在错误消息中建议的那样,尝试使用setuptools<60.0.0我试过诗歌运行pip安装setuptools==59.8.0

在执行诗歌添加scikit学习时,它会自动将设置工具升级到版本65.0,但会出现错误。

尽管如此,使用上述设置(不包括scikit-learn(,我可以成功安装numpy、panda、scipy等,而无需降级setuptools版本。

我是通过:pip3 install -U scikit-learn获得的

这应该安装scikit learn:

pip安装-U sklearn

它在我的Python 3.11系统上运行。

最新更新