Skip to main content
 首页 » 编程设计

python之我在 conda 中安装 scikit-learn 时出错

2025年01月19日18yyy_WW

当我尝试在 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