我需要sklearn,这就是为什么我尝试使用conda install scikit-learn
在conda env中安装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
,也会出现同样的情况。该如何解决?
答案 0 :(得分:2)
好吧,所以问题在于我的环境正在运行Python 3.9.0,但是scikit-learn
与3.9不兼容,因此我创建了一个新的环境,同时特别提到了Python版本。
conda create -n newEnv python=3.7.3
python 3.7.3在我的基本环境中运行,所以我选择了它。
答案 1 :(得分:0)
我刚遇到此问题,我的操作系统是Windows10。最初,我尝试卸载scikit-learn软件包并重新安装,但是失败了。然后我搜索了这个website,它着重于使用wheel的python软件包。幸运的是,现已提供与python3.9.0兼容的scikit-learn。下载正确的wheel文件后,我进入下载文件夹,并使用“ pip install << em> wheel文件名>”进行安装。它适合我的情况。为您祝福。