Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPython Notebook - ShimWarning: The `IPython.kernel` package has been deprecated

I am receiving the following message when importing some packages into IPython-Notebook:

%matplotlib notebook
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.integrate import odeint

//anaconda/lib/python3.4/site-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You should import from ipykernel or jupyter_client instead.
  "You should import from ipykernel or jupyter_client instead.", ShimWarning)

enter image description here

This does not seem to affect the results but I would like to resolve this error. I understood from some of the post here that this problem will cause IPython-Notebook to stop working when upgrading to Python 4. I am running IPython Notebook version 4.0.4 via Anaconda on Mac OSX 10.11.1.

I must admit that I am not very savvy with python package installation but I need to use this for school and thought this would a nice way to learn this stuff.

like image 871
magnity Avatar asked Nov 06 '15 16:11

magnity


Video Answer


2 Answers

I had a similar warning that was caused by the line:

%matplotlib notebook

To remove the warning update to the latest version of matplotlib (updating to 1.5.0 solved it in my case). If you use pip, then

pip install -U matplotlib
like image 159
Eolmar Avatar answered Sep 21 '22 16:09

Eolmar


I was seeing the same warning (albeit with Python 3.5) and found a GitHub issue about it from August 2015; there you can find a more complete explanation and a command likely to fix this:

jupyter kernelspec install-self --user

As a comment on the original question suggests, this is indeed a problem of a deprecated IPython kernel command. I'm not sure how universal a fix it is, but that thread explains what it's doing quite well!

like image 29
iff_or Avatar answered Sep 19 '22 16:09

iff_or