scikit-learn - 尝试安装 scikit-learn 时出现“UnsatisfiableError”
问题描述
我需要 sklearn,这就是为什么我尝试在我的 conda env 中安装 scikit-learn,conda install scikit-learn
但结果是:
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- scikit-learn -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.5,<3.6.0a0']
Your python: python=3.9
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
The following specifications were found to be incompatible with your system:
- feature:/linux-64::__cuda==9.1=0
- feature:|@/linux-64::__cuda==9.1=0
Your installed version is: 9.1
conda install -c anaconda scikit-learn
如果我尝试或,也会出现同样的情况conda install -c conda-forge scikit-learn
。如何解决这个问题?
解决方案
好的,所以问题是我的环境正在运行 Python 3.9.0 但scikit-learn
与 3.9 不兼容,所以我创建了一个新环境,同时特别提到
conda create -n newEnv python=3.7.3
python 3.7.3 的 Python 版本在我的基本环境中运行,所以我选择了它。
推荐阅读
- system - 无法启动 OMI CIM 服务器。[Linux]
- javascript - 使用 reduce 操作对象数组,缺少正确的类型
- unit-testing - Karma Jasmine - 代码覆盖率不涵盖 Observable 订阅方法中的函数
- ansible - 从 Ansible 中使用 openssl 生成的密码中替换几个特殊字符
- javascript - 试图在Javascript中添加多个项目列表
- aws-lambda - 无服务器错误:无法为
- python - 我的神经网络只能预测一类
- javascript - 如何更改 DC.JS 绘图的画布元素的 z-index?
- python - 在 Python 中对具有多个键的字典进行分组和聚合
- c# - 如何调用注入对象的基类方法?