Jupyter笔记本:找不到与python 3匹配的内核

2024-05-21 05:37:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试在不使用anaconda的情况下安装jupyter笔记本,但遇到了一些问题,特别是不断出现的红色“内核错误”

然而,通过this问题,我多少能够确定C:\Users\Ashish\AppData\Roaming\jupyter\kernels\python3kernel.json文件中的默认pythonpath用于anaconda的问题,因此我使用where python添加了python路径

在cmd上运行jupyter notebook并打开.ipynb文件时,会出现一个弹出窗口:Could not find a kernel matching Python 3. Please select a kernel,其中显示一个空下拉列表

我更新的kernel.json文件:

{
 "argv": [
  "C:\Users\Ashish\AppData\Local\Programs\Python\Python38\python.exe",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3",
 "language": "python"
}

Tags: 文件json错误情况笔记本jupyteranacondathis
1条回答
网友
1楼 · 发布于 2024-05-21 05:37:55

Nvm在运行jupyter kernelspec list时显示错误:

json.decoder.JSONDecodeError: Invalid \escape: line 3 column 6 (char 18)

通过在kernel.json文件中使用C:\\Users\\Ashish\\AppData\\Local\\Programs\\Python\\Python38\\python.exe修复了它

相关问题 更多 >