简体   繁体   English

vscode 中的 Jupyter notebook kernel 问题:Kernel 在特定文件夹中不可选

[英]Jupyter notebook kernel issue in vscode : Kernel not selectable in a specific folder

I'm a beginner in python, using jupyter notebook in VSCode.我是python的初学者,在VSCode中使用jupyter notebook。

In a specific folder, which I use as a workspace, there is no kernel available, shown as below.在我用作工作区的特定文件夹中,没有 kernel 可用,如下所示。 ('Select kernel' shows up at the top right corner) (“选择内核”出现在右上角) 在此处输入图像描述

The funny part is that if I open a folder (Ctrl K + O), including directories above or below that folder, kernel shows up in the top right corner like the image below.有趣的是,如果我打开一个文件夹 (Ctrl K + O),包括该文件夹上方或下方的目录,kernel 会显示在右上角,如下图所示。 在此处输入图像描述

I tried to reinstall VSCode, python and jupyter, but nothing solved this issue.我尝试重新安装 VSCode、python 和 jupyter,但没有解决这个问题。

Please help.请帮忙。

1.Check your Python Interpreter by using shortcuts "Ctrl+Shift+P" then type "Python: Select Interpreter" to choose your python interpreter. 1.使用快捷键“Ctrl+Shift+P”检查您的 Python Interpreter,然后键入“Python: Select Interpreter”以选择您的 python 解释器。

2.Click the button to choose your jupyter kernel. 2.点击按钮选择你的jupyter kernel。

3.If this doesn't work, open your settings.json and add the following codes to it: 3.如果这不起作用,请打开您的settings.json 。json 并向其中添加以下代码:

"python.defaultInterpreterPath":"Path/to/your/Python"

For example: "python.defaultInterpreterPath":"C:/Users/Administrator/AppData/Local/Programs/Python/Python311/python.exe"例如: "python.defaultInterpreterPath":"C:/Users/Administrator/AppData/Local/Programs/Python/Python311/python.exe"

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

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