4

i recently ran into some problems with some of the libraries on Anaconda so i reinstalled Anaconda and when i started it up again, The Jupityr Notebook kernel error spots this text:

Traceback (most recent call last):
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\web.py", line 1543, in _execute
    result = yield result
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\gen.py", line 1099, in run
    value = future.result()
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 73, in post
    type=mtype))
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\gen.py", line 1099, in run
    value = future.result()
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 79, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\gen.py", line 1099, in run
    value = future.result()
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 92, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\gen.py", line 1099, in run
    value = future.result()
  File "C:\Users\Steven\Anaconda3\lib\site-packages\tornado\gen.py", line 315, in wrapper
    yielded = next(result)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 148, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
    **kw)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "C:\Users\Steven\Anaconda3\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "C:\Users\Steven\Anaconda3\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Steven\Anaconda3\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

I get this error when i start up and open a file. It refuses to run the code, just sitting there kinda dead. The kernel error appears in nearly all of the files opened with the Jupyter notebook.

Andrei Suvorkov
  • 5,559
  • 5
  • 22
  • 48
Steven AA
  • 41
  • 1
  • 2
  • 5
    Solved this my self, appears that for some reason the kernel did not install properly. Fixed with: python -m ipykernel install --user – Steven AA Jul 06 '18 at 07:05

6 Answers6

4

The solution below worked for me. You can either run this code in command prompt in your virtual environment OR in the Anaconda prompt.

python -m ipykernel install --user

For detailed explanation and instructions have a look here.

K.T.
  • 51
  • 5
2
  • Open Anaconda Prompt
  • Activate your env
  • type: python -m ipykernel install --user
  • Start your jupyter notebook
saurabh kumar
  • 506
  • 4
  • 13
1

This solution may be helpful for Windows users.

  1. pip uninstall jupyter
  2. Go to ~\AppData\Roaming (AppData is a hidden file) and delete the folder named jupyter and python(if there exists.)
  3. Delete ~\.jupyter, ~\.ipython.
  4. pip install jupyter

I was using Jupiter without anaconda and this perfectly fixed the issue. Not sure if this works for Jupiter with anaconda.

I used this trick it worked for me, I also use Jupiter without Anaconda.

vitaliis
  • 4,082
  • 5
  • 18
  • 40
segas
  • 11
  • 2
0

I had the same problem, this quick fix solved my problem

pip3 install --upgrade --force-reinstall --no-cache-dir jupyter

Reference: Cannot uninstall requirement jupyter, not installed

0

Encountered the same thing, but the answer was surprisingly simple for me: I used VSCode to execute some of the code generating graphs, and the graphs came out too big in Jupyter Notebook, although I specified figsize (16,9).

Re-ran these in jupyter notebook, and it went just fine.

0

I had the same issue. What worked for me was python -m ipykernel install --user --name (insert your env name her) . I can now open Jupyter notebook in my virtual environment.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Blue Robin May 11 '23 at 19:36