导入sklearn时出现conda sklearn错误

2024-10-02 10:19:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我在ubuntu18上使用conda和python3.6,并尝试使用安装sklearn版本0.2

conda install scikit-learn

我正在做一些奇怪的按摩,比如这个

SafetyError: The package for scikit-learn located at /home/user/anaconda3/pkgs/scikit-learn-0.20.2-py36hd81dba3_0 appears to be corrupted. The path 'lib/python3.6/site-packages/sklearn/utils/weight_vector.cpython-36m-x86_64-linux-gnu.so' has an incorrect size. reported size: 66016 bytes actual size: 48608 bytes

然后,我得到“完成”按摩和批准,当我尝试导入sklearn时,我得到以下错误:

ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy

我错过了什么? 谢谢。在


Tags: installthe版本numpyanpackageforsize
1条回答
网友
1楼 · 发布于 2024-10-02 10:19:12

使用以下命令为项目创建单独的python环境:

conda create -n yourenvname python=3.6 scikit-learn

这应该包括scikit。在

然后启用您的环境:

^{pr2}$

有关conda环境的更多信息link to documentation


此外,您可以尝试conda uninstall scikit-learn,然后再次安装

相关问题 更多 >

    热门问题