Python Jupyter笔记本显示FileNotFoundError,无法运行任何shell
我已经安装了Jupyter: 操作系统:32位windows 7 jupyter笔记本的版本是6.0.1 安装后,当我试图打开笔记本时,它显示一个内核错误:Python Jupyter笔记本显示FileNotFoundError,无法运行任何shell,python,python-3.x,jupyter-notebook,jupyter,jupyter-lab,Python,Python 3.x,Jupyter Notebook,Jupyter,Jupyter Lab,我已经安装了Jupyter: 操作系统:32位windows 7 jupyter笔记本的版本是6.0.1 安装后,当我试图打开笔记本时,它显示一个内核错误: Traceback (most recent call last): File "E:\Jupyter\miniconda3\lib\site-packages\tornado\web.py", line 1703, in _execute result = await result File "
Traceback (most recent call last):
File "E:\Jupyter\miniconda3\lib\site-packages\tornado\web.py", line 1703, in _execute
result = await result
File "E:\Jupyter\miniconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "E:\Jupyter\miniconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "E:\Jupyter\miniconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "E:\Jupyter\miniconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "E:\Jupyter\miniconda3\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 "E:\Jupyter\miniconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "E:\Jupyter\miniconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "E:\Jupyter\miniconda3\lib\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 "E:\Jupyter\miniconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "E:\Jupyter\miniconda3\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "E:\Jupyter\miniconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "E:\Jupyter\miniconda3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "E:\Jupyter\miniconda3\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
**kw)
File "E:\Jupyter\miniconda3\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "E:\Jupyter\miniconda3\lib\site-packages\jupyter_client\launcher.py", line 138, in launch_kernel
proc = Popen(cmd, **kwargs)
File "E:\Jupyter\miniconda3\lib\subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "E:\Jupyter\miniconda3\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
因为这个原因,我不能用Jupyter运行任何东西。
如何修复它?这是您的环境的问题。以下是调试它的方法: 检查Jupyter配置中指定的内核(请参阅Linux上的
%APPDATA%\Jupyter\kernels\\kernel.json
/~/.local/share/Jupyter/kernels//kernel.json)是否可以通过命令行启动
例如,在我的kernel.json
文件中,有:
{
"argv": [
"/home/mrmino/.virtualenvs/taf/bin/python3.7",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
}
因此,在我的系统上,命令/home/mrmino/.virtualenvs/taf/bin/python3.7-m ipykernel_启动器
应该启动ipython内核
如果在您的系统上没有,您必须安装它或在JSON内核规范文件中手动更正它。我在“C:\Users\abc\AppData\Local\Programs\Python\Python38-32\share\jupyter\kernels\python3”中找到kernels.JSON文件,它包含以下代码:{“argv”:[“Python”、“-m”、“ipykernel\u启动器”、“-f”、“{connection\u file}],“display_name”:“Python 3”,“language”:“Python”}
我认为它在第二行延迟了,那么我应该提供哪种Python呢?conda environment python还是普通python?@Akshatsah是-m ipykernel_launcher
的工作环境。可能就是你开始使用Jupyter的那个。@BlazejMichanlik这有点棘手,因为我在“E:/”中安装了conda环境,anaconda提示符以“C:/”打开,所以我在使用它时遇到了问题,而且我的系统中安装了不止一个python,比如conda、3.7和3.8,所以你能帮我一下吗。谢谢:)@akshatsah这不是关于蟒蛇提示,而是关于系统的cmd
。为解释器二进制文件设置一个完整路径,它应该可以工作。正如我在编辑中提到的那样,我改变了.json文件。谢谢你的关心和帮助,我真的很感激。谢谢:)