Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"An error ocurred while starting the kernel" about wrong version of spyder-kernels is displayed despite being installed #17027

Closed
leavor opened this issue Dec 15, 2021 · 11 comments

Comments

@leavor
Copy link

leavor commented Dec 15, 2021

Problem Description

To create a new virtual environment, use the following command:

conda create -n python3.8.12 python=3.8.12 spyder=5.2.1

Start spyder, the following error occurred:
image

Restart kernel, the following occurred:

Python 3.8.12 | packaged by conda-forge | (default, Sep 16 2021, 01:40:49) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 7.29.0 -- An enhanced Interactive Python.
Cannot restart a kernel not started by Spyder

Versions

  • Spyder version: 5.2.1
  • Python version: 3.8.12
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: windows 10

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.29.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.0 (OK)
jellyfish >=0.7               :  0.8.9 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.4.0 (OK)
nbconvert >=4.0               :  6.1.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
paramiko >=2.4.0              :  2.7.2 (OK)
parso >=0.7.0;<0.9.0          :  0.8.2 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.10.0 (OK)
pylint >=2.5.0                :  2.9.6 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.3.2;<1.4.0          :  1.3.3 (OK)
pylsp_black >=1.0.0           :  1.0.0 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.3 (OK)
qtconsole >=5.2.1;<5.3.0      :  5.2.2 (OK)
qtpy >=1.5.0                  :  1.10.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  58.0.4 (OK)
sphinx >=0.6.6                :  4.2.0 (OK)
spyder_kernels >=2.2.0;<2.3.0 :  2.2.0 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=2.0.0            :  None (NOK)
numpy >=1.7                   :  None (NOK)
pandas >=1.1.1                :  None (NOK)
scipy >=0.17.0                :  None (NOK)
sympy >=0.7.3                 :  None (NOK)
@leavor
Copy link
Author

leavor commented Dec 15, 2021

I also created python=3.9.7, the issue is the same!

@ccordoba12
Copy link
Member

Hey @leavor, thanks for reporting. Please open the Anaconda prompt and run there

spyder --reset

That should fix your problem, which is most likely caused by not having the right version of Spyder-kernels in the environment you have selected in Preferences > Python interpreter.

@leavor
Copy link
Author

leavor commented Dec 15, 2021

@ccordoba12, do as you say, can solve this error

@ccordoba12
Copy link
Member

Great! Thanks for letting us know about it.

To not force users to do a reset to solve this problem, we'll inform them what's the interpreter that doesn't have the right version of spyder-kernels installed in the message you displayed in the first screenshot.

I think that will help them to understand to better understand what's happening in this case.

@ccordoba12 ccordoba12 changed the title An error ocurred while starting the kernel "An error ocurred while starting the kernel" about wrong version of spyder-kernels is displayed despite having it Dec 15, 2021
@ccordoba12 ccordoba12 added this to the v5.2.2 milestone Dec 15, 2021
@ccordoba12 ccordoba12 changed the title "An error ocurred while starting the kernel" about wrong version of spyder-kernels is displayed despite having it "An error ocurred while starting the kernel" about wrong version of spyder-kernels is displayed despite being installed Dec 16, 2021
@Martlexisn
Copy link

Hey @leavor, thanks for reporting. Please open the Anaconda prompt and run there

spyder --reset

That should fix your problem, which is most likely caused by not having the right version of Spyder-kernels in the environment you have selected in Preferences > Python interpreter.

Hey @ccordoba12 ,

I saw you helping many people in the same case of kernels problems. I also have this problem with the same error message. It tell me that "Your Python environment or installation doesn't have the spyder-kernels module or the right version of it installed". So I did what you said and went in preference and changed the python interpreter to "default" (it was before in "- /opt/anaconda3/bin/python"). I'm not very good at understanding that but I guess I'M now using the basic python of my computer and not the one from anaconda ???. And well, it's working now, but it's means im not having any package that was on my anaconda environment. ??

@ccordoba12
Copy link
Member

I'm not very good at understanding that but I guess I'M now using the basic python of my computer and not the one from anaconda ???

Not exactly. That simply means that you're using the same Python interpreter on which Spyder is running (because Spyder is also a Python application).

And well, it's working now, but it's means im not having any package that was on my anaconda environment. ??

Possibly. Did you use our macOS app to install Spyder?

@jcborgesjr
Copy link

Hey @leavor, thanks for reporting. Please open the Anaconda prompt and run there

spyder --reset

That should fix your problem, which is most likely caused by not having the right version of Spyder-kernels in the environment you have selected in Preferences > Python interpreter.

It worked once, but the problem reoccurred.

@erdoganb
Copy link

I have the same issue. I've installed the spyder alone. Without anaconda.
and also, in spyder's terminal, when i go pip install "the kernels"
says: no module named "pip"
what am i doing wrong?

@ccordoba12
Copy link
Member

@erdoganb, pip is not provided in our Windows and Mac installers so that people can't easily break them by installing other things with it. If you want to use other packages that don't come with the installers, please read our documentation on how to do that.

@darcycordell
Copy link

What is the "Anaconda Prompt" and how do I open it?

@ccordoba12
Copy link
Member

@darcycordell, if you're on Windows, look for "Anaconda Prompt" in the Start menu. If not, simply open a terminal (Terminal.app on Mac or Konsole/Gnome Terminal on Linux).

Then, see the video shown in the link I posted in my previous comment to understand what you need to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants