Jupyter Notebook - Cannot Connect to Kernel

后端 未结 10 1739
小蘑菇
小蘑菇 2021-02-20 02:21

I\'ve tried installing jupyter notebook using pip3 install jupyter. Every time i launch a new jupyter notebook, the notebook is unable to connect to the kernel. See screenshot b

相关标签:
10条回答
  • 2021-02-20 02:36

    I had the same issue where the kernel would simply not connect. Tried every solution, still no connection.

    In the end I noticed some ValueError Exceptions being raised in the console where I started the jupyter client. The source of these exceptions was another python script in the same folder as the notebook.

    Fixed the script. Fixed the notebook.

    0 讨论(0)
  • 2021-02-20 02:39

    I simply just restarted the Anaconda program and opened a new Python 3 notebook, and Jupyter could connect. :)

    0 讨论(0)
  • 2021-02-20 02:43

    I got this error:

    from prompt_toolkit.eventloop import generator_to_async_generator
    ImportError: cannot import name 'generator_to_async_generator' from 'prompt_toolkit.eventloop' (/Users/danielmlow/miniconda3/envs/pydra/lib/python3.7/site-packages/prompt_toolkit/eventloop/__init__.py)
    

    So I upgraded prompt_toolkit:

    pip install prompt_toolkit==3.0.
    
    0 讨论(0)
  • 2021-02-20 02:47

    There is a likelihood that you've updated Tornado to 6.0.0 recently. Try reinstalling it to version 5.1.1. It just helped me. Lost 1 hour of precious Saturday time on this.

    0 讨论(0)
  • 2021-02-20 02:49

    for linux and windows:

         just install ipython kernel
    
               "python3 -m pip install ipykernel"
    
               "python3 -m ipykernel install --user"
    
          then restart jupyter notebook that's it
    
    0 讨论(0)
  • 2021-02-20 02:52

    I experienced a similar issue on my old PC converted into a Ubuntu 20.04 server, with Jupyterlab running under Jupyterhub. The issue appeared after installing Jupytext with the following command:

    python3 -m pip install jupytext --upgrade
    

    which non only installed Jupytext but also upgraded my system to Jupyterlab 2.2.9 and Jupyterhub 1.2.2 (among other packages updates).

    After that, running a cell containing the simple code:

    3 * 4
    

    under any python 3.6 kernel or even R 3.6 or 4.0 kernel left me with the status message:

    Kernel xxx connecting...

    but never completing the connection nor the simple computation.

    Neither re-installing Tornado to version 5.1.1., nor reinstalling ipywidgets, succeeded in solving the issue.

    But finally downgrading Jupyterlab and Jupyterhub to (approximately) the original version numbers worked for me:

    python3 -m pip install wheel jupyterhub==1.1.0 jupyterlab==2.1.0 ipywidgets
    

    According to the command outputs, the following packages versions were actually applied:

    Installing collected packages: wheel, jupyterhub
      Attempting uninstall: wheel
        Found existing installation: wheel 0.34.2
        Uninstalling wheel-0.34.2:
          Successfully uninstalled wheel-0.34.2
      Attempting uninstall: jupyterhub
        Found existing installation: jupyterhub 1.1.0
        Uninstalling jupyterhub-1.1.0:
          Successfully uninstalled jupyterhub-1.1.0
    Successfully installed jupyterhub-1.2.2 wheel-0.36.1
    

    And after restarting jupyterhub, all my kernels were working again.

    0 讨论(0)
提交回复
热议问题