question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

spyder kernels installed but not recognised?

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

I’m a novice so forgive my ignorance! I’m using a different python environment to spyder’s default. I have checked that the correct version of spyder-kernels is installed in this environment, however when using spyder I still get the following message in the IPython console:

The Python environment or installation whose interpreter is located at C:\Program Files\Python39\python.exe doesn’t have the spyder‑kernels module or the right version of it installed (>= 2.3.0 and < 2.4.0). Without this module is not possible for Spyder to create a console for you.

You can install it by activating your environment (if necessary) and then running in a system terminal: conda install spyder‑kernels=2.3 or pip install spyder‑kernels==2.3.*

The correct version is definitely installed:

C:\Users\dixonb3>pip list Package Version


asttokens 2.0.5 backcall 0.2.0 cloudpickle 1.6.0 colorama 0.4.4 cycler 0.10.0 debugpy 1.6.0 decorator 5.0.9 entrypoints 0.4 executing 0.8.3 ipykernel 6.12.1 ipython 7.32.0 ipython-genutils 0.2.0 jedi 0.18.0 jupyter-client 7.2.1 jupyter-core 4.9.2 kiwisolver 1.3.1 matplotlib 3.4.2 matplotlib-inline 0.1.2 nest-asyncio 1.5.5 numpy 1.21.0 packaging 21.3 parso 0.8.2 pickleshare 0.7.5 Pillow 8.2.0 pip 21.1.1 prompt-toolkit 3.0.19 psutil 5.9.0 pure-eval 0.2.2 pydicom 2.2.2 Pygments 2.9.0 pyparsing 2.4.7 python-dateutil 2.8.2 pywin32 301 pyzmq 22.3.0 setuptools 56.0.0 six 1.16.0 spyder-kernels 2.3.0 stack-data 0.2.0 tornado 6.1 traitlets 5.1.1 wcwidth 0.2.5

And the executable below matches the location I have set in the spyder python interpreter preferences:

C:\Users\dixonb3>python Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32 Type “help”, “copyright”, “credits” or “license” for more information.

import sys print(sys.executable) C:\Program Files\Python39\python.exe

What steps reproduce the problem?

  1. Opening spyder

What is the expected output? What do you see instead?

Expected: functioning iPython console. Seen instead: error as above (no spyder-kernels >= 2.3.0 despite it being installed)

Versions

  • Spyder version: 5.3.0 None
  • Python version: 3.8.10 64-bit
  • Qt version: 5.15.2
  • PyQt5 version: 5.15.6
  • Operating System: 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.3 (OK)
diff_match_patch >=20181111          :  20200713 (OK)
intervaltree                         :  None (OK)
IPython >=7.31.1;<8.0.0              :  7.32.0 (OK)
jedi >=0.17.2;<0.19.0                :  0.18.1 (OK)
jellyfish >=0.7                      :  0.9.0 (OK)
jsonschema >=3.2.0                   :  4.4.0 (OK)
keyring >=17.0.0                     :  23.5.0 (OK)
nbconvert >=4.0                      :  6.4.5 (OK)
numpydoc >=0.6.0                     :  1.2.1 (OK)
paramiko >=2.4.0                     :  2.10.3 (OK)
parso >=0.7.0;<0.9.0                 :  0.8.3 (OK)
pexpect >=4.4.0                      :  4.8.0 (OK)
pickleshare >=0.4                    :  0.7.5 (OK)
psutil >=5.3                         :  5.9.0 (OK)
pygments >=2.0                       :  2.11.2 (OK)
pylint >=2.5.0                       :  2.13.3 (OK)
pyls_spyder >=0.4.0                  :  0.4.0 (OK)
pylsp >=1.4.1;<1.5.0                 :  1.4.1 (OK)
pylsp_black >=1.2.0                  :  1.2.0 (OK)
qdarkstyle >=3.0.2;<3.1.0            :  3.0.3 (OK)
qstylizer >=0.1.10                   :  0.2.1 (OK)
qtawesome >=1.0.2                    :  1.1.1 (OK)
qtconsole >=5.3.0;<5.4.0             :  5.3.0 (OK)
qtpy >=2.0.1                         :  2.0.1 (OK)
rtree >=0.9.7                        :  0.9.7 (OK)
setuptools >=49.6.0                  :  61.2.0 (OK)
sphinx >=0.6.6                       :  4.5.0 (OK)
spyder_kernels >=2.3.0;<2.4.0        :  2.3.0 (OK)
textdistance >=4.2.0                 :  4.2.2 (OK)
three_merge >=0.1.1                  :  0.1.1 (OK)
watchdog                             :  2.1.7 (OK)
zmq >=17                             :  22.3.0 (OK)

# Optional:
cython >=0.21                        :  0.29.28 (OK)
matplotlib >=3.0.0                   :  3.5.1 (OK)
numpy >=1.7                          :  1.22.3 (OK)
pandas >=1.1.1                       :  1.4.1 (OK)
scipy >=0.17.0                       :  1.8.0 (OK)
sympy >=0.7.3                        :  1.10.1 (OK)

# Spyder plugins:
spyder_terminal.terminalplugin 1.2.2 :  1.2.2 (OK)

Extremely grateful for any help- I’m going insane.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
dixonb3commented, Apr 13, 2022

Hi @dalthviz and @ccordoba12 - The Connect to an existing kernel option worked! Thanks so much for your help!

2reactions
ghostcommented, Jul 20, 2022

I fixed my issue by changing the default package installation path of pip. My python is installed in C:\Program Files\Python\Python3, and pip is in C:\Program Files\Python\Python3\Scripts, however, I found the default package installation path is under C:\Users\usrname\AppData\, which spyder doesn’t recognize. my solution is to change the pip installation path to the same path as python and pip, python3 -m site shows the path of pip installed packages, and we can find where to change the path by python3 -m site -help, it shows that we can change the path in C:\Program Files\Python\Python3\lib\site.py. now I changed the path and python -m site get:

sys.path = [
    'C:\\WINDOWS\\system32',
    'C:\\Program Files\\Python\\Python3\\python38.zip',
    'C:\\Program Files\\Python\\Python3\\DLLs',
    'C:\\Program Files\\Python\\Python3\\lib',
    'C:\\Program Files\\Python\\Python3',
    'C:\\Program Files\\Python\\Python3\\site-packages',
    'C:\\Program Files\\Python\\Python3\\lib\\site-packages',
    'C:\\Program Files\\Python\\Python3\\lib\\site-packages\\win32',
    'C:\\Program Files\\Python\\Python3\\lib\\site-packages\\win32\\lib',
    'C:\\Program Files\\Python\\Python3\\lib\\site-packages\\Pythonwin',
]
USER_BASE: 'C:\\Program Files\\Python\\Python3\\Scripts' (exists)
USER_SITE: 'C:\\Program Files\\Python\\Python3\\site-packages' (exists)
ENABLE_USER_SITE: True

and then pip install spyder-kernels==2.3.*, it will be installed under c:\program files\python\python3\, which spyder can recognize.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Illnesses — Spyder 5 documentation
Spyder -Kernels not installed/incompatible¶ ; Spyder requires a supported version of the spyder-kernels package to be present in the working environment you want ......
Read more >
I have the correct spyder kernels installed but ...
For this enviroment I need python 3.9 for another package which is not available for python 3.10 and hence the reason why an...
Read more >
spyder-kernels
Package that provides Jupyter kernels for use with the consoles of Spyder, the Scientific Python Development Environment. These kernels can launched either ...
Read more >
Can Spyder and Jupyter Notebooks coexist in Arc Pro 3.0?
Solved: It would be nice to have both Spyder and Jupyter Notebooks both working in Arc Pro 3.0. Thanks to suggestions from ,...
Read more >
Problems with new venv on Anaconda. Spyder ask for ...
Spyder ask for spyder-kernels module but doesn't detect it. 43 views ... It seems that Spyder is not able to see the new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found