简体   繁体   English

jupyter笔记本(Python3)中的默认kernel不起作用

[英]Default kernel in jupyter notebook (Python3) not working

I installed Anaconda3 having Python 3.7.3 on Windows 10. When I launch Jupyter Notebook from Anaconda3 Navigator using environment: base(root), it shows kernel error and Python 3 (which is default kernel) as dead kernel. I installed Anaconda3 having Python 3.7.3 on Windows 10. When I launch Jupyter Notebook from Anaconda3 Navigator using environment: base(root), it shows kernel error and Python 3 (which is default kernel) as dead kernel.

The kernel error is: kernel 错误是:

Traceback (most recent call last): File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 1699, in _execute result = await result File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\handlers.py", line 72, in post type=mtype)) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run value = future.result() File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "C:\Users\Admin\AppData\Roaming\Python\Python37\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\Admin\AppData\Roaming\回溯(最后一次调用):文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\web.py”,第 1699 行,_execute 结果 = 等待结果文件“C:\ Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "C:\Users\ Admin\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\handlers.py”,第 72 行,在 post type=mtype)) 文件“C:\Users\Admin\AppData\Roaming\Python\ Python37\site-packages\tornado\gen.py”,第 735 行,运行值 = future.result() 文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen. py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\ sessionmanager.py”,第 88 行,在 create_session kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name) 文件“C:\Users\Admin\AppData\Roaming\ Python\Python37\site-packages\tornado\gen.py", line 735, in run value = future.result() File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "C:\Users\Admin\AppData\Roaming\Python\Python37\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:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run value = future.result() File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 209, in wrapper yielded = next(result) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel super(MappingKernelManager, self).start_kernel(**kwargs) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\mu Python\Python37\site-packages\tornado\gen.py”,第 735 行,运行值 = future.result() 文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\ gen.py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\notebook\services\ session\sessionmanager.py”,第 101 行,在 start_kernel_for_session self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name) 文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen .py”,第 735 行,运行值 = future.result() 文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py”,第 209 行,在包装中产生= next(result) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\notebook\services\kernels\kernelmanager.py",第 168 行,在 start_kernel super(MappingKernelManager, self).start_kernel (**kwargs) 文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\mu ltikernelmanager.py", line 110, in start_kernel km.start_kernel(**kwargs) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\manager.py", line 240, in start_kernel self.write_connection_file() File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 547, in write_connection_file kernel_name=self.kernel_name File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 212, in write_connection_file with secure_write(fname) as f: File "C:\Users\Admin\Anaconda3\lib\contextlib.py", line 112, in enter return next(self.gen) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 100, in secure_write win32_restrict_file_to_user(fname) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 53, in win32_restrict_file_to_user import win32api ImportError: DLL load fail ltikernelmanager.py”,第 110 行,在 start_kernel km.start_kernel(**kwargs) 文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\manager.py”,第 240 行,在start_kernel self.write_connection_file() 文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py”,第 547 行,在 write_connection_file kernel_name=self.kernel_name 文件“C:\Users \Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py",第 212 行,在 write_connection_file 中,secure_write(fname) 为 f:文件 "C:\Users\Admin\Anaconda3\lib\contextlib. py",第 112 行,输入return next(self.gen) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py",第 100 行,在secure_write win32_restrict_file_to_user( fname) 文件“C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py”,第 53 行,win32_restrict_file_to_user 导入 win32api ImportError: DLL 加载失败ed: The specified procedure could not be found. ed:找不到指定的过程。

I am new to Python and anaconda, please help someone!我是 Python 和 anaconda 的新手,请帮助别人!

Seeing the slew of error you are getting, i advise you to reinstall anaconda on windows 10. Kernel errors aren't easily solved.看到您遇到的大量错误,我建议您在 windows 10 上重新安装 anaconda。Kernel 错误不容易解决。 So, reinstalling is the easiest way to solve this... given link should help:===>所以,重新安装是解决这个问题的最简单方法......给定的链接应该有帮助:===>

Installing anaconda on W10 在 W10 上安装 anaconda

1)In jupyter notebook if you find "kernel dead" then click file and select close and halt option.When notebook gets closed you can go to kernel and click restart. 1)在 jupyter notebook 中,如果你发现“kernel dead”然后点击文件和 select 关闭和停止选项。当笔记本关闭时,你可以 go 到 Z50484C19F1AFDAF3841A0D821ED393D2 并单击重新启动。

2) If the above instruction didn't work then uninstall and install the following packages 2)如果上述说明不起作用,请卸载并安装以下软件包

    jupyter_client
    jupyter_core
    ipykernel
    ipython
    ipython_genutils 
    traitlets

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM