Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
241 views
in Technique[技术] by (71.8m points)

python 3.x - Failed to start the kernel in Jupyter Notebook

After reinstall anaconda3 (Anaconda3-2020.07-Windows-x86_64) in Windows10. I got the following 'failed to start the kernel' error with Jupiter notebook (version 6.0.3). Please help with your idea. Many thanks.
Please see error image as attached enter image description here

########################

Traceback (most recent call last):
  File "C:UsersAdministratoranaconda3libsite-packagesornadoweb.py", line 1703, in _execute
    result = await result
  File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:UsersAdministratoranaconda3libsite-packages
otebookservicessessionshandlers.py", line 69, in post
    model = yield maybe_future(
  File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 735, in run
    value = future.result()
  File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:UsersAdministratoranaconda3libsite-packages
otebookservicessessionssessionmanager.py", line 88, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 735, in run
    value = future.result()
  File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:UsersAdministratoranaconda3libsite-packages
otebookservicessessionssessionmanager.py", line 100, in start_kernel_for_session
    kernel_id = yield maybe_future(
  File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 735, in run
    value = future.result()
  File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 209, in wrapper
    yielded = next(result)
  File "C:UsersAdministratoranaconda3libsite-packages
otebookserviceskernelskernelmanager.py", line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "C:UsersAdministratoranaconda3libsite-packagesjupyter_clientmultikernelmanager.py", line 186, in start_kernel
    km.start_kernel(**kwargs)
  File "C:UsersAdministratoranaconda3libsite-packagesjupyter_clientmanager.py", line 308, in start_kernel
    self.kernel = self._launch_kernel(kernel_cmd, **kw)
  File "C:UsersAdministratoranaconda3libsite-packagesjupyter_clientmanager.py", line 215, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "C:UsersAdministratoranaconda3libsite-packagesjupyter_clientlauncher.py", line 135, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "C:UsersAdministratoranaconda3libsubprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:UsersAdministratoranaconda3libsubprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

###################################################

[I 11:28:26.834 NotebookApp] The port 8888 is already in use, trying another port.
[I 11:28:26.834 NotebookApp] The port 8889 is already in use, trying another port.
[I 11:28:27.127 NotebookApp] JupyterLab extension loaded from C:UsersAdministratoranaconda3libsite-packagesjupyterlab
[I 11:28:27.127 NotebookApp] JupyterLab application directory is C:UsersAdministratoranaconda3sharejupyterlab
[I 11:28:27.129 NotebookApp] Serving notebooks from local directory: C:UsersAdministrator
[I 11:28:27.129 NotebookApp] The Jupyter Notebook is running at:
[I 11:28:27.129 NotebookApp] http://localhost:8890/?token=a6a1dace41d990751285a7d79a0134c18fb7e27403b72b9f
[I 11:28:27.129 NotebookApp] or http://127.0.0.1:8890/?token=a6a1dace41d990751285a7d79a0134c18fb7e27403b72b9f
[I 11:28:27.130 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:28:27.165 NotebookApp] 

To access the notebook, open this file in a browser:
file:///C:/Users/Administrator/AppData/Roaming/jupyter/runtime/nbserver-4328-open.html
Or copy and paste one of these URLs:
http://localhost:8890/?token=a6a1dace41d990751285a7d79a0134c18fb7e27403b72b9f
or http://127.0.0.1:8890/?token=a6a1dace41d990751285a7d79a0134c18fb7e27403b72b9f
[E 11:28:34.207 NotebookApp] Failed to run command:
['C:\Users\Administrator\Anaconda3\envs\OpenPose\python.exe', '-m', 'ipykernel_launcher', '-f', 'C:\Users\Administrator\AppData\Roaming\jupyter\runtime\kernel-91bf3e96-0093-48bb-aed3-27ac4fd137ea.json']
PATH='C:\Users\Administrator\anaconda3;C:\Users\Administrator\anaconda3\Library\mingw-w64\bin;C:\Users\Administrator\anaconda3\Library\usr\bin;C:\Users\Administrator\anaconda3\Library\bin;C:\Users\Administrator\anaconda3\Scripts;C:\Users\Administrator\anaconda3\bin;C:\Users\Administrator\anaconda3\condabin;C:\Users\Administrator\anaconda3;C:\Users\Administrator\anaconda3\Library\mingw-w64\bin;C:\Users\Administrator\anaconda3\Library\usr\bin;C:\Users\Administrator\anaconda3\Library\bin;C:\Users\Administrator\anaconda3\Scripts;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;.;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NGX;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Users\Administrator\swigwin-4.0.2;C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Scripts;C:\Users\Administrator\Anaconda3\envs\Tensorflow;C:\Users\Administrator\Anaconda3\Scripts;C:\Program Files\NVIDIA Corporation\NVIDIA NGX;C:\Program Files\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;C:\windows\System\cmd.exe;C:\Users\Administrator\wget-1.20.3-win64;C:\tf-pose-estimation;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Users\Administrator\AppData\Roaming\npm;C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Scripts;C:\Program Files\NVIDIA Corporation\NVIDIA NGX;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;C:\Users\Administrator\wget-1.20.3-win64;C:\tf-pose-estimation;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\libnvvp;.'
with kwargs:
{'stdin': -1, 'stdout': None, 'stderr': None, 'cwd': 'C:\Users\Administrator', 'close_fds': False}

[E 11:28:34.207 NotebookApp] Uncaught exception POST /api/sessions (::1)
HTTPServerRequest(protocol='http', host='localhost:8890', method='POST', uri='/api/sessions', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:UsersAdministratoranaconda3libsite-packagesornadoweb.py", line 1703, in _execute
result = await result
File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:UsersAdministratoranaconda3libsite-packages
otebookservicessessionshandlers.py", line 69, in post
model = yield maybe_future(
File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 735, in run
value = future.result()
File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:UsersAdministratoranaconda3libsite-packages
otebookservicessessionssessionmanager.py", line 88, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 735, in run
value = future.result()
File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:UsersAdministratoranaconda3libsite-packages
otebookservicessessionssessionmanager.py", line 100, in start_kernel_for_session
kernel_id = yield maybe_future(
File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 735, in run
value = future.result()
File "C:UsersAdministratoranaconda3libsite-packagesornadogen.py", line 209, in wrapper
yielded = next(result)
File "C:UsersAdministratoranaconda3libsite-packages
otebookserviceskernelskernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:UsersAdministratoranaconda3libsite-packagesjupyter_clientmultikernelmanager.py", line 186, in start_kernel
km.start_kernel(**kwargs)
File "C:UsersAdministratoranaconda3libsite-packagesjupyter_clientmanager.py", line 308, in start_kernel
self.kernel = self._launch_kernel(kernel_cmd, **kw)
File "C:UsersAdministratoranaconda3libsite-packagesjupyter_clientmanager.py", line 215, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "C:UsersAdministratoranaconda3libsite-packagesjupyter_clientlauncher.py", line 135, in launch_kernel
proc = Popen(cmd, **kwargs)
File "C:UsersAdministratoranaconda3libsubprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:UsersAdministratoranaconda3libsubprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
[W 11:28:34.212 NotebookApp] Unhandled error
[E 11:28:34.212 NotebookApp] {
"Host": "localhost:8890",
"Connection": "keep-alive",
"Content-Length": "88",
"Sec-Ch-Ua": ""Google Chrome";v="87", " Not;A Brand";v="99", "Chromium";v="87"",
"Accept": "application/json, text/javascript, */*; q=0.01",
"X-Xsrftoken": "2|c377403e|a6d8d419183582cc511c7dc84109799d|1611520120",
"X-Requested-With": "XMLHttpRequest",
"Sec-Ch-Ua-Mobile": "?0",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36",
"Content-Type": "application/json",
"Origin": "http://localhost:8890",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Dest": "empty",
"Referer": "http://localhost:8890/notebooks/David.ipynb",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Cookie": "_xsrf=2|c377403e|a6d8d419183582cc511c7dc84109799d|1611520120; username-localhost-8889="2|1:0|10:1611573692|23:username-localhost-8889|44:MzQ4ZDkzMjBiZTFlNDFkNjk1OTM4Y2I5YjM5ZTNiNjg=|6b3cf989ea68afed756dee88608ef04356080625076e8bf271c374ac0eafc5cd"; username-localhost-8890="2|1:0|10:1611574108|23:username-localhost-8890|44:ZDRmZDJjMWVlYTYxNDBhMGI0YjJkYmIzYzFiNTU5MDk=|dd855fdb4b3e8eb95c7a10159ac248d68e26591d7e67121fdd5eb03e494e70c7""
}
[E 11:28:34.212 NotebookApp] 500 POST /api/sessions (::1) 34.91ms referer=http://localhost:8890/n

otebooks/David.ipynb

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It has been solved. Steps are listed below:

First, stop those running or dead servers, from anaconda prompt:

jupyter notebook list (list currently running servers)

jupyter notebook stop [port number] (e.g. jupyter notebook stop 8888)

jupyter --paths (Check where your runtime folder is located)

del -r [path to runtime folder]/* 

Second, remove jupyter notebook and reinstall it, from anaconda navigator:

  • jupyter notebook->remove application

  • then manually delete the jupyter folder: AppDataRoamingjupyter (AppData might be a hidden folder)

  • re-install jupyter notebook

Moreover, I uninstalled python 3.7 to avoid any conflicts, since python 3.8 is installed with anaconda3, however not sure if that also helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...