当我在anaconda中打开spyder时,该spyder指示在spyder中启动内核时发生错误。

时间:2019-12-03 02:27:56

标签: python kernel spyder

当我在anaconda中打开Spyder时,Spyder指示在Spyder中启动内核时发生错误。我已经尝试了(在终端中)来自Spyder的两个建议命令。但是,重新启动anaconda并打开Spyder后,仍然存在相同的问题,因此我不知道如何解决该问题。谢谢您的帮助!

以下是Spyder打开时的内容:

An error occurred while starting the kernel

Your Python environment or installation doesn't have the spyder‑kernels module or the right version of it installed. Without this module is not possible for Spyder to create a console for you.

You can install it by running in a system terminal:

conda install spyder‑kernels=0.*

or

pip install spyder‑kernels==0.*

终端中的结果在下面列出。

(base) pn-204-190:~ yangboning$ conda install spyder-kernels=0.*
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

(base) pn-204-190:~ yangboning$ pip install spyder-kernels==0.*
Requirement already satisfied: spyder-kernels==0.* in ./opt/anaconda3/lib/python3.7/site-packages (0.5.2)
Requirement already satisfied: ipykernel>=4.8.2 in ./opt/anaconda3/lib/python3.7/site-packages (from spyder-kernels==0.*) (5.1.2)
Requirement already satisfied: wurlitzer; platform_system != "Windows" in ./opt/anaconda3/lib/python3.7/site-packages (from spyder-kernels==0.*) (1.0.3)
Requirement already satisfied: pyzmq>=17 in ./opt/anaconda3/lib/python3.7/site-packages (from spyder-kernels==0.*) (18.1.0)
Requirement already satisfied: cloudpickle in ./opt/anaconda3/lib/python3.7/site-packages (from spyder-kernels==0.*) (1.2.2)
Requirement already satisfied: jupyter-client>=5.2.3 in ./opt/anaconda3/lib/python3.7/site-packages (from spyder-kernels==0.*) (5.3.3)
Requirement already satisfied: traitlets>=4.1.0 in ./opt/anaconda3/lib/python3.7/site-packages (from ipykernel>=4.8.2->spyder-kernels==0.*) (4.3.3)
Requirement already satisfied: ipython>=5.0.0 in ./opt/anaconda3/lib/python3.7/site-packages (from ipykernel>=4.8.2->spyder-kernels==0.*) (7.8.0)
Requirement already satisfied: tornado>=4.2 in ./opt/anaconda3/lib/python3.7/site-packages (from ipykernel>=4.8.2->spyder-kernels==0.*) (6.0.3)
Requirement already satisfied: python-dateutil>=2.1 in ./opt/anaconda3/lib/python3.7/site-packages (from jupyter-client>=5.2.3->spyder-kernels==0.*) (2.8.0)
Requirement already satisfied: jupyter-core in ./opt/anaconda3/lib/python3.7/site-packages (from jupyter-client>=5.2.3->spyder-kernels==0.*) (4.5.0)
Requirement already satisfied: ipython-genutils in ./opt/anaconda3/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel>=4.8.2->spyder-kernels==0.*) (0.2.0)
Requirement already satisfied: six in ./opt/anaconda3/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel>=4.8.2->spyder-kernels==0.*) (1.12.0)
Requirement already satisfied: decorator in ./opt/anaconda3/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel>=4.8.2->spyder-kernels==0.*) (4.4.0)
Requirement already satisfied: jedi>=0.10 in ./opt/anaconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (0.15.1)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in ./opt/anaconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (2.0.10)
Requirement already satisfied: pygments in ./opt/anaconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (2.4.2)
Requirement already satisfied: pickleshare in ./opt/anaconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (0.7.5)
Requirement already satisfied: appnope; sys_platform == "darwin" in ./opt/anaconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (0.1.0)
Requirement already satisfied: setuptools>=18.5 in ./opt/anaconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (41.4.0)
Requirement already satisfied: pexpect; sys_platform != "win32" in ./opt/anaconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (4.7.0)
Requirement already satisfied: backcall in ./opt/anaconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (0.1.0)
Requirement already satisfied: parso>=0.5.0 in ./opt/anaconda3/lib/python3.7/site-packages (from jedi>=0.10->ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (0.5.1)
Requirement already satisfied: wcwidth in ./opt/anaconda3/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (0.1.7)
Requirement already satisfied: ptyprocess>=0.5 in ./opt/anaconda3/lib/python3.7/site-packages (from pexpect; sys_platform != "win32"->ipython>=5.0.0->ipykernel>=4.8.2->spyder-kernels==0.*) (0.6.0)
(base) pn-204-190:~ yangboning$ 

3 个答案:

答案 0 :(得分:2)

如果@lyq 的解决方案不起作用,这对我有用。

打开 Anaconda 提示符并运行以下行:

spyder --reset

答案 1 :(得分:0)

您可以尝试:

conda install spyder-kernels

pip install spyder-kernels

答案 2 :(得分:0)

here 检查兼容版本的 spyder-kernel 并像这样使用 pip 安装-

pip install spyder-kernels== COMPATIBLE VERSION