title: Jupyter Lab and Notebook Problem: Kernel Error
body: <p>It appears that somehow one of my kernels is deleted. And perhaps that's why I am getting this error. How could I possibly fix it? Can I reinstall something (the kernel in the <strong>base environment</strong> perhaps)?</p>
  
  <p>If no better option is available, I would try reinstalling anaconda altogether as a last resort according to: <a href="https://stackoverflow.com/questions/58200576/default-kernel-in-jupyter-notebook-python3-not-working">Default kernel in jupyter notebook (Python3) not working</a>.</p>
  
  <p><a href="https://i.stack.imgur.com/0cZXU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0cZXU.png" alt="enter image description here"></a></p>
  
  <p>I have tried using the following:  </p>
  
  <ol>
  <li><a href="https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html" rel="nofollow noreferrer">Installation of Jupyter Lab: <code>requirements already satisfied</code></a>  </li>
  <li><a href="https://github.com/QuantStack/xeus-cling/issues/177" rel="nofollow noreferrer">Kernels don't show up when runnning "jupyter lab"</a>  </li>
  <li><a href="https://github.com/jupyterlab/jupyterlab/issues/1018" rel="nofollow noreferrer">UI says "No kernel" while I definitively have one</a>  </li>
  <li><a href="https://github.com/jupyter/notebook/issues/3556" rel="nofollow noreferrer">Getting Kernel Error while running Jupyter Notebook in Python3</a>  </li>
  <li><a href="https://ipython.readthedocs.io/en/latest/install/kernel_install.html" rel="nofollow noreferrer">https://ipython.readthedocs.io/en/latest/install/kernel_install.html</a>  </li>
  <li><a href="https://medium.com/flatiron-engineering/recovering-from-a-jupyter-disaster-27401677aeeb" rel="nofollow noreferrer">https://medium.com/flatiron-engineering/recovering-from-a-jupyter-disaster-27401677aeeb</a>  </li>
  </ol>
  
  <h2>Current List of Kernels</h2>
  
  <pre><code>jupyter kernelspec list
  </code></pre>
  
  <p>Output:  </p>
  
  <pre><code>Available kernels:
    python3    C:\Users\raysu\AppData\Roaming\jupyter\kernels\python3
    vpython    C:\ProgramData\jupyter\kernels\vpython
  </code></pre>
  
  <p>But I must have another kernel (which I suppose somehow got deleted) associated with my base environment.  </p>
  
  <pre><code>C:\Users\raysu\Documents&gt;conda env list
  # conda environments:
  #
  base                  *  C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64
  astra_env                C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\envs\astra_env
  bokeh_env                C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\envs\bokeh_env
  sound_env                C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\envs\sound_env
  tf_env                   C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\envs\tf_env
                           C:\Users\raysu\Anaconda3
                           C:\Users\raysu\Anaconda3\envs\pyforge
  opencv_env               C:\Users\raysu\AppData\Local\conda\conda\envs\opencv_env
  test_env                 C:\Users\raysu\AppData\Local\conda\conda\envs\test_env
  </code></pre>
  
  <h1>Error</h1>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tornado\web.py", line 1699, in _execute
      result = await result
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tornado\gen.py", line 742, in run
      yielded = self.gen.throw(*exc_info)  # type: ignore
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
      type=mtype))
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tornado\gen.py", line 735, in run
      value = future.result()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tornado\gen.py", line 742, in run
      yielded = self.gen.throw(*exc_info)  # type: ignore
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
      kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tornado\gen.py", line 735, in run
      value = future.result()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tornado\gen.py", line 742, in run
      yielded = self.gen.throw(*exc_info)  # type: ignore
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
      self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tornado\gen.py", line 735, in run
      value = future.result()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\tornado\gen.py", line 209, in wrapper
      yielded = next(result)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
      super(MappingKernelManager, self).start_kernel(**kwargs)
    File "C:\Users\raysu\AppData\Roaming\Python\Python36\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
      km.start_kernel(**kwargs)
    File "C:\Users\raysu\AppData\Roaming\Python\Python36\site-packages\jupyter_client\manager.py", line 240, in start_kernel
      self.write_connection_file()
    File "C:\Users\raysu\AppData\Roaming\Python\Python36\site-packages\jupyter_client\connect.py", line 476, in write_connection_file
      kernel_name=self.kernel_name
    File "C:\Users\raysu\AppData\Roaming\Python\Python36\site-packages\jupyter_client\connect.py", line 141, in write_connection_file
      with secure_write(fname) as f:
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\contextlib.py", line 81, in __enter__
      return next(self.gen)
    File "C:\Users\raysu\AppData\Roaming\Python\Python36\site-packages\jupyter_core\paths.py", line 404, in secure_write
      win32_restrict_file_to_user(fname)
    File "C:\Users\raysu\AppData\Roaming\Python\Python36\site-packages\jupyter_core\paths.py", line 359, in win32_restrict_file_to_user
      import win32api
  ImportError: DLL load failed: The specified procedure could not be found.
  
  </code></pre>