在 Jupyter Notebook 中启动内核失败

如何解决在 Jupyter Notebook 中启动内核失败

在 Windows10 中重新安装 anaconda3 (Anaconda3-2020.07-Windows-x86_64) 后。我在使用 Jupiter Notebook(6.0.3 版)时遇到以下“无法启动内核”错误。请帮助您的想法。非常感谢。
请参阅附件中的错误图像 enter image description here

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

Traceback (most recent call last):
  File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\web.py",line 1703,in _execute
    result = await result
  File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",line 742,in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\Administrator\anaconda3\lib\site-packages\notebook\services\sessions\handlers.py",line 69,in post
    model = yield maybe_future(
  File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",line 735,in run
    value = future.result()
  File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\Administrator\anaconda3\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:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",line 100,in start_kernel_for_session
    kernel_id = yield maybe_future(
  File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",line 209,in wrapper
    yielded = next(result)
  File "C:\Users\Administrator\anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py",line 168,in start_kernel
    super(MappingKernelManager,self).start_kernel(**kwargs)
  File "C:\Users\Administrator\anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py",line 186,in start_kernel
    km.start_kernel(**kwargs)
  File "C:\Users\Administrator\anaconda3\lib\site-packages\jupyter_client\manager.py",line 308,in start_kernel
    self.kernel = self._launch_kernel(kernel_cmd,**kw)
  File "C:\Users\Administrator\anaconda3\lib\site-packages\jupyter_client\manager.py",line 215,in _launch_kernel
    return launch_kernel(kernel_cmd,**kw)
  File "C:\Users\Administrator\anaconda3\lib\site-packages\jupyter_client\launcher.py",line 135,in launch_kernel
    proc = Popen(cmd,**kwargs)
  File "C:\Users\Administrator\anaconda3\lib\subprocess.py",line 854,in __init__
    self._execute_child(args,executable,preexec_fn,close_fds,File "C:\Users\Administrator\anaconda3\lib\subprocess.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:\Users\Administrator\anaconda3\lib\site-packages\jupyterlab
[I 11:28:27.127 NotebookApp] JupyterLab application directory is C:\Users\Administrator\anaconda3\share\jupyter\lab
[I 11:28:27.129 NotebookApp] Serving notebooks from local directory: C:\Users\Administrator
[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:\Users\Administrator\anaconda3\lib\site-packages\tornado\web.py",in _execute
result = await result
File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Administrator\anaconda3\lib\site-packages\notebook\services\sessions\handlers.py",in post
model = yield maybe_future(
File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",in run
value = future.result()
File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Administrator\anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",in create_session
kernel_id = yield self.start_kernel_for_session(session_id,kernel_name)
File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",in start_kernel_for_session
kernel_id = yield maybe_future(
File "C:\Users\Administrator\anaconda3\lib\site-packages\tornado\gen.py",in wrapper
yielded = next(result)
File "C:\Users\Administrator\anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py",in start_kernel
super(MappingKernelManager,self).start_kernel(**kwargs)
File "C:\Users\Administrator\anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py",in start_kernel
km.start_kernel(**kwargs)
File "C:\Users\Administrator\anaconda3\lib\site-packages\jupyter_client\manager.py",in start_kernel
self.kernel = self._launch_kernel(kernel_cmd,**kw)
File "C:\Users\Administrator\anaconda3\lib\site-packages\jupyter_client\manager.py",in _launch_kernel
return launch_kernel(kernel_cmd,**kw)
File "C:\Users\Administrator\anaconda3\lib\site-packages\jupyter_client\launcher.py",in launch_kernel
proc = Popen(cmd,**kwargs)
File "C:\Users\Administrator\anaconda3\lib\subprocess.py",in __init__
self._execute_child(args,in _execute_child
hp,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

解决方法

另一种简单的解决方案是:

  1. 打开您的 Anaconda Prompt。
  2. 激活您的 env(如果您不使用 envs,则此步骤是可选的)
  3. 运行:python -m ipykernel install --user
  4. 启动您的 jupyter 笔记本

查看https://github.com/jupyter/notebook/issues/4079了解更多信息

,

已经解决了。步骤如下:

首先,从 anaconda 提示符处停止那些正在运行或停止运行的服务器:

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]/* 

其次,从anaconda navigator中删除jupyter notebook并重新安装:

  • jupyter notebook->删除应用程序

  • 然后手动删除jupyter文件夹:AppData\Roaming\jupyter(AppData可能是隐藏文件夹)

  • 重新安装 jupyter notebook

此外,我卸载了 python 3.7 以避免任何冲突,因为 python 3.8 与 anaconda3 一起安装,但不确定这是否也有帮助。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-