我有一些代码尝试从KernalManager
导入IPython
,但我收到警告
/home/alex/Projects/VETests/ipyrunner/local/lib/python2.7/site-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated since IPython 4.0.You should import from ipykernel or jupyter_client instead.
"You should import from ipykernel or jupyter_client instead.", ShimWarning)
但是当我执行以下操作时
from ipykernel import KernelManager
我收到错误
ImportError: cannot import name KernelManager
如何正确做到?
答案 0 :(得分:0)
替换
from IPython.kernel import KernelManager
/ from ipykernel import KernelManager
与
from jupyter_client.manager import KernelManager
。