PS Collecting sklearn
Using cached sklearn-0.0.post12.tar.gz (2.6 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [15 lines of output]
The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
rather than 'sklearn' for pip commands.
Here is how to fix this error in the main use cases:
- use 'pip install scikit-learn' rather than 'pip install sklearn'
- replace 'sklearn' by 'scikit-learn' in your pip requirements files
(requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
- if the 'sklearn' package is used by one of your dependencies,
it would be great if you take some time to track which package uses
'sklearn' instead of 'scikit-learn' and report it to their issue tracker
- as a last resort, set the environment variable
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error
More information is available at
https://github.com/scikit-learn/sklearn-pypi-package
error: subprocess-exited-with-error
我在运行代码的时候发现
ModuleNotFoundError: No module named 'sklearn'
所以按照以往的经验,直接pip了,就出现了上述报错。
后来查阅了很多相关博文都无法解决,最后才回到报错本身,其实人家已经提示了问题所在。
其实该问题的起源还是自己不常配环境,一旦出错就开始搜寻他人的相关经验,而不自己寻找问题。所以下次出问题还是要从问题本身下手才可以真正自己解决问题呀!!