当我尝试在conda中安装scikit-learn时,我收到以下错误
$ conda install scikit-learn
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment
/Users/xlnwel/anaconda/envs/ai:
The following NEW packages will be INSTALLED:
scikit-learn: 0.19.0-np113py36_0
scipy: 0.19.1-np113py36_0
Proceed ([y]/n)? y
ERROR conda.core.link:_execute_actions(335): An error occurred while installing package 'defaults::scipy-0.19.1-np113py36_0'.
FileExistsError(17, 'File exists')
Attempting to roll back.
FileExistsError(17, 'File exists')
我想这可能是因为scipy已经存在,所以我尝试删除scipy,仍然收到错误:
$ conda remove scipy
Fetching package metadata ...........
Solving package specifications: .
PackageNotFoundError: Package not found: Conda could not find '
我现在能做什么?我正在使用 Mac。
-
如果依赖项已经满足,请尝试安装
scikit-learn
包,忽略scipy
包:conda install --no-deps scikit-learn
所有这些技巧在我的 ubuntu 机器中都不起作用。
最终,需要指定 numpy 和 scipy 版本。 您可以通过以下方式获取版本
conda list > /tmp/conda_tmp1
pip install -U scikit-learn
conda list > /tmp/conda_tmp2
diff /tmp/conda_tmp1 /tmp/conda_tmp2
然后检查输出