title: Kernel not connecting in Jupyter Lab
body: <p>The kernel says connecting and then says No Kernel | Disconnected.
  I have clean-uninstalled anaconda and uninstalled all jupyter using
  <code>python -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console jupyterlab_pygments notebook qtconsole nbconvert nbformat</code></p>
  <p>Searching anaconda or jupyter in Home directory gave nothing.</p>
  <p>Then, I fresh installed anaconda and still the problem stays.</p>
  <p>At first, it seemed kernel was connecting with a new notebook but after some time kernel was connecting in a new notebook.
  (<strong>Update:</strong> I found out that the new notebooks are connecting to kernel until an old notebook is opened. Once an old notebook is opened, then onwards, no notebooks are connecting to kernel)</p>
  <p>I'm stuck on this.</p>
  <p>The following is what I get in the terminal:</p>
  <pre><code>[I 2021-08-01 21:01:42.797 ServerApp] nbclassic | extension was successfully linked.
  [I 2021-08-01 21:01:42.846 LabApp] JupyterLab extension loaded from /home/username/anaconda3/lib/python3.8/site-packages/jupyterlab
  [I 2021-08-01 21:01:42.846 LabApp] JupyterLab application directory is /home/username/anaconda3/share/jupyter/lab
  [I 2021-08-01 21:01:42.849 ServerApp] jupyterlab | extension was successfully loaded.
  [I 2021-08-01 21:01:42.852 ServerApp] nbclassic | extension was successfully loaded.
  [I 2021-08-01 21:01:42.852 ServerApp] Serving notebooks from local directory: /home/username
  [I 2021-08-01 21:01:42.853 ServerApp] Jupyter Server 1.4.1 is running at:
  [I 2021-08-01 21:01:42.853 ServerApp] http://localhost:8888/lab?token=3d46a4259293e2afc5f584cf2d62586c5c553fd37e55e775
  [I 2021-08-01 21:01:42.853 ServerApp]  or http://127.0.0.1:8888/lab?token=3d46a4259293e2afc5f584cf2d62586c5c553fd37e55e775
  [I 2021-08-01 21:01:42.853 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
  [C 2021-08-01 21:01:42.877 ServerApp] 
      
      To access the server, open this file in a browser:
          file:///home/username/.local/share/jupyter/runtime/jpserver-9804-open.html
      Or copy and paste one of these URLs:
          http://localhost:8888/lab?token=3d46a4259293e2afc5f584cf2d62586c5c553fd37e55e775
       or http://127.0.0.1:8888/lab?token=3d46a4259293e2afc5f584cf2d62586c5c553fd37e55e775
  [I 2021-08-01 21:01:48.429 LabApp] Build is up to date
  [W 2021-08-01 21:01:49.469 ServerApp] Notebook Desktop/Link to foldername/ms-p/peroo/anl.ipynb is not trusted
  [I 2021-08-01 21:01:52.346 ServerApp] Kernel started: 7bbe2308-8b30-4a4b-8b04-31aabe33d635
  Traceback (most recent call last):
    File &quot;/home/username/anaconda3/lib/python3.8/runpy.py&quot;, line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File &quot;/home/username/anaconda3/lib/python3.8/runpy.py&quot;, line 87, in _run_code
      exec(code, run_globals)
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel_launcher.py&quot;, line 15, in &lt;module&gt;
      from ipykernel import kernelapp as app
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel/__init__.py&quot;, line 2, in &lt;module&gt;
      from .connect import *
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel/connect.py&quot;, line 13, in &lt;module&gt;
      from IPython.core.profiledir import ProfileDir
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/__init__.py&quot;, line 55, in &lt;module&gt;
      from .core.application import Application
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/application.py&quot;, line 25, in &lt;module&gt;
      from IPython.core import release, crashhandler
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/crashhandler.py&quot;, line 27, in &lt;module&gt;
      from IPython.core import ultratb
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/ultratb.py&quot;, line 112, in &lt;module&gt;
      from IPython.core import debugger
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/debugger.py&quot;, line 47, in &lt;module&gt;
      from pdb import Pdb as OldPdb
    File &quot;/home/username/anaconda3/lib/python3.8/pdb.py&quot;, line 77, in &lt;module&gt;
      import code
    File &quot;/home/username/Desktop/Projects/foldername/ms-p/peroo/code.py&quot;, line 535, in &lt;module&gt;
      &quot;execution_count&quot;: null,
  NameError: name 'null' is not defined
  [I 2021-08-01 21:01:55.348 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new random ports
  Traceback (most recent call last):
    File &quot;/home/username/anaconda3/lib/python3.8/runpy.py&quot;, line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File &quot;/home/username/anaconda3/lib/python3.8/runpy.py&quot;, line 87, in _run_code
      exec(code, run_globals)
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel_launcher.py&quot;, line 15, in &lt;module&gt;
      from ipykernel import kernelapp as app
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel/__init__.py&quot;, line 2, in &lt;module&gt;
      from .connect import *
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel/connect.py&quot;, line 13, in &lt;module&gt;
      from IPython.core.profiledir import ProfileDir
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/__init__.py&quot;, line 55, in &lt;module&gt;
      from .core.application import Application
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/application.py&quot;, line 25, in &lt;module&gt;
      from IPython.core import release, crashhandler
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/crashhandler.py&quot;, line 27, in &lt;module&gt;
      from IPython.core import ultratb
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/ultratb.py&quot;, line 112, in &lt;module&gt;
      from IPython.core import debugger
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/debugger.py&quot;, line 47, in &lt;module&gt;
      from pdb import Pdb as OldPdb
    File &quot;/home/username/anaconda3/lib/python3.8/pdb.py&quot;, line 77, in &lt;module&gt;
      import code
    File &quot;/home/username/Desktop/Projects/foldername/ms-p/peroo/code.py&quot;, line 535, in &lt;module&gt;
      &quot;execution_count&quot;: null,
  NameError: name 'null' is not defined
  [I 2021-08-01 21:01:58.362 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (2/5), new random ports
  Traceback (most recent call last):
    File &quot;/home/username/anaconda3/lib/python3.8/runpy.py&quot;, line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File &quot;/home/username/anaconda3/lib/python3.8/runpy.py&quot;, line 87, in _run_code
      exec(code, run_globals)
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel_launcher.py&quot;, line 15, in &lt;module&gt;
      from ipykernel import kernelapp as app
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel/__init__.py&quot;, line 2, in &lt;module&gt;
      from .connect import *
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/ipykernel/connect.py&quot;, line 13, in &lt;module&gt;
      from IPython.core.profiledir import ProfileDir
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/__init__.py&quot;, line 55, in &lt;module&gt;
      from .core.application import Application
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/application.py&quot;, line 25, in &lt;module&gt;
      from IPython.core import release, crashhandler
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/crashhandler.py&quot;, line 27, in &lt;module&gt;
      from IPython.core import ultratb
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/ultratb.py&quot;, line 112, in &lt;module&gt;
      from IPython.core import debugger
    File &quot;/home/username/anaconda3/lib/python3.8/site-packages/IPython/core/debugger.py&quot;, line 47, in &lt;module&gt;
      from pdb import Pdb as OldPdb
    File &quot;/home/username/anaconda3/lib/python3.8/pdb.py&quot;, line 77, in &lt;module&gt;
      import code
    File &quot;/home/username/Desktop/Projects/foldername/ms-p/peroo/code.py&quot;, line 535, in &lt;module&gt;
      &quot;execution_count&quot;: null,
  NameError: name 'null' is not defined
  </code></pre>