为了账号安全,请及时绑定邮箱和手机立即绑定

python 2和3上不同版本的SKlearn

python 2和3上不同版本的SKlearn

桃花长相依 2021-05-21 18:01:45
我试图在python 2上运行一些代码,但我不断收到此错误No module named model_selection。我检查了一下,出于某种原因,我的python2上的sklearn是版本0.17,但是当我尝试更新时,它说我已经有一个更新的版本,但这是针对python 3的。我如何专门为python 2更新sklearn?运行时出现错误pip install -U scikit-learn:Requirement already up-to-date: scikit-learn in /home/ruven/anaconda3/lib/python3.6/site-packages (0.19.2)运行时出现错误python2.7 -m pip install -U scikit-learn:Collecting scikit-learn  Using cached https://files.pythonhosted.org/packages/bc/67/370aa248f54769a56216707ad7b9af19745e85a603fafa47bde353f327fb/scikit_learn-0.19.2-cp27-cp27mu-manylinux1_x86_64.whlInstalling collected packages: scikit-learn  Found existing installation: scikit-learn 0.17Cannot uninstall 'scikit-learn'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
查看完整描述

2 回答

?
慕的地10843

TA贡献1785条经验 获得超8个赞

sudo easy_install --upgrade scikit-learn


查看完整回答
反对 回复 2021-05-25
?
30秒到达战场

TA贡献1828条经验 获得超6个赞

使用以下命令解决:

sudo easy_install --upgrade scikit-learn


查看完整回答
反对 回复 2021-05-25
  • 2 回答
  • 0 关注
  • 114 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信