python 2和3上不同版本的SKlearn

我试图在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.whl

Installing collected packages: scikit-learn

  Found existing installation: scikit-learn 0.17

Cannot 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.


桃花长相依
浏览 115回答 2
2回答

慕的地10843

sudo easy_install --upgrade scikit-learn

30秒到达战场

使用以下命令解决:sudo easy_install --upgrade scikit-learn
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python