当我打开Jupyter Notebook时,出现内核错误

我一直在尝试使用TensorFlow进行有关对象检测的Python项目。一切正常,直到我在“ tensorflow1”环境中运行Jupyter Notebook。当Jupyter Notebook打开时,在窗口的右上角会出现一个红色的Kernel Error。当我单击它时,会显示类似消息

  

回溯(最近通话最近一次):

     

文件   “ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ tornado \ web.py”,   _execute中的1699行       结果=等待结果文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ tornado \ gen.py”,   742行       yielded = self.gen.throw(* exc_info)#类型:忽略文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ notebook \ services \ sessions \ handlers.py”,   第72行       type = mtype))文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ tornado \ gen.py”,   735行       值= future.result()文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ tornado \ gen.py”,   742行       yielded = self.gen.throw(* exc_info)#类型:忽略文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ notebook \ services \ sessions \ sessionmanager.py”,   第88行,在create_session中       kernel_id = yield self.start_kernel_for_session(session_id,路径,名称,类型,kernel_name)文件   “ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ tornado \ gen.py”,   735行       值= future.result()文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ tornado \ gen.py”,   742行       yielded = self.gen.throw(* exc_info)#类型:忽略文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ notebook \ services \ sessions \ sessionmanager.py”,   第101行,在start_kernel_for_session中       self.kernel_manager.start_kernel(路径=内核路径,内核名称=内核名称)文件   “ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ tornado \ gen.py”,   735行       值= future.result()文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ tornado \ gen.py”,   包装中的第209行       产生=下一个(结果)文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ notebook \ services \ kernels \ kernelmanager.py”,   第168行,位于start_kernel中       超级(MappingKernelManager,自我)。start_kernel(** kwargs)文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ jupyter_client \ multikernelmanager.py”,   第110行,位于start_kernel中       km.start_kernel(** kwargs)文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ jupyter_client \ manager.py”,   第240行,位于start_kernel中       self.write_connection_file()文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ jupyter_client \ connect.py”,   第476行,在write_connection_file中       kernel_name = self.kernel_name文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ jupyter_client \ connect.py”,   第141行,在write_connection_file中       使用secure_write(fname)作为f:文件“ D:\ Anaconda \ envs \ tensorflow1 \ lib \ contextlib.py”,第81行,在   输入       返回next(self.gen)文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ jupyter_core \ paths.py”,   第424行,在secure_write中       win32_restrict_file_to_user(fname)文件“ C:\ Users \ Yasin \ AppData \ Roaming \ Python \ Python36 \ site-packages \ jupyter_core \ paths.py”,   第32行,在win32_restrict_file_to_user中       导入win32api

     

ImportError:DLL加载失败:无法指定的过程   找到。

我尝试更改内核,但只有一个名为“ Python3”的内核。我试图将其删除,并创建了一个名为“ Python tensorflow1”的新内核。我试图用该内核运行代码,但它仍然给我红色错误。

它也显示无法启动内核。

limo2737 回答:当我打开Jupyter Notebook时,出现内核错误

请使用以下命令激活环境tensorflow1并在该环境中安装ipykernel:

conda activate tensorflow1
conda install ipykernel
ipython kernel install --name tensorflow1 --user

然后尝试使用以下命令使用Access Jupyter Notebook:

jupyter notebook

如果上述步骤无效,请按照以下步骤创建新的conda环境并从该环境访问jupyter笔记本:

conda create -n env_tf -c intel python=3.6

成功创建conda环境后,可以使用以下命令列出环境:

conda env list

它应该是列表:

D:\ Anaconda \ envs \ env_tf

使用以下命令激活环境:

conda activate env_tf

在激活的环境中安装ipykernel:

conda install ipykernel

ipython kernel install --name env_tf --user 

使用以下命令访问jupyter笔记本:

jupyter notebook

希望这会有所帮助。

本文链接:https://www.f2er.com/3127597.html

大家都在问