sklearn_extra 安装问题
Posted
技术标签:
【中文标题】sklearn_extra 安装问题【英文标题】:sklearn_extra installation issue 【发布时间】:2020-04-24 08:48:05 【问题描述】:[输入]:
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 <module>
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 <module>
import locale
File "c:\users\m\appdata\local\programs\python\python37\lib\locale.py", line 16, in <module>
import re
File "c:\users\m\appdata\local\programs\python\python37\lib\re.py", line 143, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
我检查了 Cython、Python 和 sklearn 的版本,它们满足要求的范围。
编辑:感谢 Balraj Ashwatt 的评论,解决方案是为我卸载 enum34。
pip uninstall -y enum34
然后我就可以安装 sklearn_extra
【问题讨论】:
我们可以得到完整的日志吗? 这些链接可能会有所帮助:1) github.com/iterative/dvc/issues/1995#issuecomment-496661430 2) ***.com/questions/43124775/… 3) 你确定你已经安装到合适的环境中了吗?最近因为安装到系统 python 而不是项目一而与jupyter
混淆
@A.Ametov 我想我的问题是通过我这边的命令 pip uninstall -y enum34 解决的
【参考方案1】:
我试过了,
pip install scikit-learn-extra
这对我来说似乎没问题 !
【讨论】:
【参考方案2】:卸载 enum34 对我有用,然后我能够安装 sklearn_extra
pip uninstall -y enum34
【讨论】:
【参考方案3】:试试这个命令:
conda install -c conda-forge scikit-learn-extra
【讨论】:
以上是关于sklearn_extra 安装问题的主要内容,如果未能解决你的问题,请参考以下文章