'Python environment or installation doesn't have the spyder-kernels module or the right version of it installed

I've tried several of the other suggestions/answers on this exact topic.

I used Spyder-kernel 2.0.5 with Spyder 5.0.5 with Python 3.9.6.

The env activation process and kernel install process completes normally, (also tells me I have all the requested items).

The next start of Spyder 5.0.5 reports Your Python environment or installation doesn't have the spyder-kernels module or the right version of it installed.....

Do I need different version combinations of Python, Spyder, & Kernels?



Solution 1:[1]

In case it helps, I made it working using mamba and calling (this installs tensorflow as well).

Chossing the python and spyder-kernels versions

mamba create --name tf python==3.7 tensorflow spyder-kernels==2.0.5

(change tf to your favorite virtual environment name)

At home, it works on Spyder 5.0.1 using IPython 7.31.1.

I did not reusse to make it working usinf conda, but I may have not tried all possibilities.

To run Spyder in a given virtual environmene, please follow this anwser : How to run Spyder in virtual environment?

Get the last available versions

Install spyder inside the virtual environment directly:

mamba create --name tf tensorflow spyder

(it will ask for erasing the previously constructed tf environment in case you ran the first command)

Then activate the environment and run spyder:

mamba activate tf
spyder

You do not need to change the path of the Python interpreter in spyder in that case, since it is embarked inside the virtual environment.

The first lines of the IPython console are then

Python 3.9.12 (main, Apr  5 2022, 06:56:58) 
Type "copyright", "credits" or "license" for more information.

IPython 8.2.0 -- An enhanced Interactive Python.

on Spyder 5.1.5 (on 2022/04/20).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1