简体   繁体   English

Jupyter Notebook 中的旧 sklearn 版本

[英]old sklearn version in Jupyter Notebook

I update sklearn version by terminal with我通过终端更新sklearn版本

conda install scikit-learn=0.18

if I list with conda list scikit-learn如果我用conda list scikit-learn

# packages in environment at /Users/Claudia/anaconda:
scikit-learn              0.18.1              np111py27_1
scikit-learn              0.18.1                    <pip>

but if I run in notebook但如果我在笔记本中运行

print('The scikit-learn version is {}.'.format(sklearn.__version__))

the result is结果是

The scikit-learn version is 0.17.1.

How can I solve and update also the version in Jupyter Notebook?如何解决和更新 Jupyter Notebook 中的版本?

to update the version used by Jupyter you need to open terminal by Jupiter interface要更新 Jupyter 使用的版本,您需要通过 Jupiter 界面打开终端jupyter 界面

and run command from here并从这里运行命令

 conda update scikit-learn

the mistake was the use of the system terminal.错误是使用系统终端。

I solved this by python -m pip install scikit-learn --upgrade我通过python -m pip install scikit-learn --upgrade解决了这个问题
check Python loading old version of sklearn检查Python 加载旧版本的 sklearn

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM