Python VS代码错误:不支持的KernelSpec文件

Python VS代码错误:不支持的KernelSpec文件,python,visual-studio-code,Python,Visual Studio Code,我正在尝试使用Visual Studio代码中的Jupyter笔记本 首先,我在VS代码中激活了一个蟒蛇环境 Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P). 然后我创建了一个Jupyter笔记本 Jupyter: Create Blank New Jupyter Notebook 但是当我运行一个简单的python代码时 print('hello') 它只显示以下消息> Unsuppor

我正在尝试使用Visual Studio代码中的Jupyter笔记本

首先,我在VS代码中激活了一个蟒蛇环境

Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).
然后我创建了一个Jupyter笔记本

Jupyter: Create Blank New Jupyter Notebook
但是当我运行一个简单的python代码时

print('hello')
它只显示以下消息>

Unsupported KernelSpec file. args must be [<pythonPath>, '-m', <moduleName>, arg1, arg2, ..]. Provied C:/Users/yaho2/anaconda3/Library/bin/xpython --ip=127.0.0.1 --stdin=9035 --control=9033 --hb=9032 --Session.signature_scheme="hmac-sha256" --Session.key=b"061677b1-19c7-4f62-bac9-90b41d414be9" --shell=9034 --transport="tcp" --iopub=9036 --f=C:\Users\yaho2\AppData\Local\Temp\tmp-200161VHjIuKuubrn.json
不支持的KernelSpec文件。args必须是[,'-m',arg1,arg2,…]。提供的C:/Users/yaho2/anaconda3/Library/bin/xpython--ip=127.0.0.1--stdin=9035--control=9033--hb=9032--Session.signature\u scheme=“hmac-sha256”-Session.key=b“061677b1-19c7-4f62-bac9-90B414BE9”--shell=9034--transport=“tcp”--iopub=9036--f=C:\Users\yaho2\AppData\Local Temp\200161vhjukuubrn.json

有没有办法解决这个问题?

请检查VS代码的扩展“Jupyter”和“Python”是否可用,并确保内核“ipykernel”已安装在当前的Python环境中。此外,请尝试使用其他Python环境并重新加载VS代码。