sklearn

您所在的位置:网站首页 python如何安装sklearn sklearn

sklearn

#sklearn| 来源: 网络整理| 查看: 265

在……里面

from sklearn_extra.cluster import KMedoids

输出

ModuleNotFoundError: No module named 'sklearn_extra'

然后,我尝试通过以下方式安装sklearn_extra

在……里面

python -m pip install sklearn_extra

输出

ERROR: Could not find a version that satisfies the requirement sklearn_extra (from versions: none) ERROR: No matching distribution found for sklearn_extra

然后,我转到网站的安装部分(https://scikit-learn-extra.readthedocs.io/en/latest/install.html),并按照它所说的做了:

Installation Dependencies scikit-learn-extra requires, Python (>=3.5) scikit-learn (>=0.21), and its dependencies Cython (>0.28) User installation Latest development version can be installed with, pip install https://github.com/scikit-learn-contrib/scikit-learn-extra/archive/master.zip

在……里面

pip install https://github.com/scikit-learn-contrib/scikit-learn-extra/archive/master.zip

输出

ERROR: Command errored out with exit status 1: command: 'c:\users\m\appdata\local\programs\python\python37\python.exe' 'c:\users\m\appdata\local\programs\python\python37\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\m\AppData\Local\Temp\pip-build-env-yopprv13\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.28' numpy==1.14.5 cwd: None Complete output (14 lines): Traceback (most recent call last): File "c:\users\m\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\m\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "c:\users\m\appdata\local\programs\python\python37\lib\site-packages\pip\__main__.py", line 16, in from pip._internal.main import main as _main # isort:skip # noqa File "c:\users\m\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\main.py", line 8, in import locale File "c:\users\m\appdata\local\programs\python\python37\lib\locale.py", line 16, in import re File "c:\users\m\appdata\local\programs\python\python37\lib\re.py", line 143, in class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'

我检查了Cython、Python和sklearn的版本,它们满足要求的范围。

编辑:多亏了Balraj Ashwatt的评论,解决方案就是帮我卸载enum34。

pip uninstall -y enum34

然后我就可以安装sklearn_extra了



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3