jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.75k stars 4.99k forks source link

ImportError: cannot import name 'default_gui_banner' #4375

Open zhuantouer opened 5 years ago

zhuantouer commented 5 years ago

env: mac: 10.13.6 python: Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13) all the pip, jupyter, notebook are latest.

WARNING:root:kernel ae65b357-ee9b-418e-9e20-951e8f7e5877 restarted
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/py3env/lib/python3.6/site-packages/ipykernel/__main__.py", line 2, in <module>
    from ipykernel import kernelapp as app
  File "/Users/py3env/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 37, in <module>
    from .ipkernel import IPythonKernel
  File "/Users/py3env/lib/python3.6/site-packages/ipykernel/ipkernel.py", line 15, in <module>
    from .zmqshell import ZMQInteractiveShell
  File "/User/py3env/lib/python3.6/site-packages/ipykernel/zmqshell.py", line 35, in <module>
    from IPython.core.usage import default_gui_banner
ImportError: cannot import name 'default_gui_banner'
[W 17:25:02.663 NotebookApp] KernelRestarter: restart failed
[W 17:25:02.664 NotebookApp] Kernel ae65b357-ee9b-418e-9e20-951e8f7e5877 died, removing from map.
ERROR:root:kernel ae65b357-ee9b-418e-9e20-951e8f7e5877 restarted failed!
[W 17:25:02.685 NotebookApp] 410 DELETE /api/sessions/285bed08-c1f6-47e2-980d-ada309f17398 (::1): Kernel deleted before session
[W 17:25:02.686 NotebookApp] Kernel deleted before session
[W 17:25:02.687 NotebookApp] 410 DELETE /api/sessions/285bed08-c1f6-47e2-980d-ada309f17398 (::1) 6.11ms referer=http://localhost:8888/notebooks/Untitled.ipynb
lgwangh commented 5 years ago

I met a similar problem. env: Windows10 (17134.590) Python 3.5.4 in Anaconda custom (64-bit)

[I 21:51:36.501 NotebookApp] Kernel started: f8c6a611-814c-4607-bcc4-3d70ba587445
Traceback (most recent call last):
  File "C:\Anaconda\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Anaconda\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Anaconda\lib\site-packages\ipykernel\__main__.py", line 2, in <module>
    from ipykernel import kernelapp as app
  File "C:\Anaconda\lib\site-packages\ipykernel\kernelapp.py", line 37, in <module>
    from .ipkernel import IPythonKernel
  File "C:\Anaconda\lib\site-packages\ipykernel\ipkernel.py", line 15, in <module>
    from .zmqshell import ZMQInteractiveShell
  File "C:\Anaconda\lib\site-packages\ipykernel\zmqshell.py", line 35, in <module>
    from IPython.core.usage import default_gui_banner
ImportError: cannot import name 'default_gui_banner'
pasindubawantha commented 5 years ago

Update your ipython for Anaconda users (@lgwangh) : conda update conda conda update ipython for users using pyenv (@zishuaiz) : I think this will fix it pip3 update ipython

lgwangh commented 5 years ago

In fact, I reinstalled the whole python, and this problem was fixed. But still thank you :smile: