spyder kernels installed but not recognised?
See original GitHub issueIssue 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
(orpip
, 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?
- 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:
- Created a year ago
- Comments:14 (6 by maintainers)
Hi @dalthviz and @ccordoba12 - The Connect to an existing kernel option worked! Thanks so much for your help!
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 inC:\Program Files\Python\Python3\Scripts
, however, I found the default package installation path is underC:\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 bypython3 -m site -help
, it shows that we can change the path inC:\Program Files\Python\Python3\lib\site.py
. now I changed the path andpython -m site
get:and then
pip install spyder-kernels==2.3.*
, it will be installed underc:\program files\python\python3\
, which spyder can recognize.