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
Windows Python Spyder can't see spyder-kernels in virtual environment #21864
Comments
Hi @saraahmed88 what version of Spyder are you using? Seems like you ended up in your |
Hi @dalthviz, I am using spyder 4.0.1, py37_0 |
Thank you for the new info @saraahmed88 I would say that such an old version of Spyder could be having troubles to properly detect the custom interpreter then 🤔 Also, just to see if I'm fully understanding your current setup: you are launching Spyder 4.0.1 from an env with Python 3.7 (the Spyder version you mentioned has the Just in case, as a workaround to try, could it be possible for you to start manually the kernel from your Any other info to further understand what could be happening is greatly appreciated. Let us know! |
Thank you so much @dalthviz for your answer. I am launching Spyder 4.0.1 with the default Python 3.7 that comes with it. I am sorry, the env (windturbine) is not used. I set up a custom interpreter from a new env (mypy11env) with Python 3.11. I have used (python -m spyder_kernels.console) in the Anaconda prompt, and it gives: And then I connected to the kernal 6068 and it works, I didnt know that to make it work, I needed to leave the anaconda prompt with the (python -m spyder_kernels.console) running while connecting to the kernal. its working now. Many thanks @dalthviz |
I believe I have the same issue. Spyder 5.5.4, but this showed up in earlier 5.x versions as well. Windows 10 with Python 3.10.x (but same with 3.11, 3.12)
I have already done the pip install and verified the packages are installed and correct version (says version 2.5.1) and it still gets the same error message. |
@Isaac000, did you install spyder-kernels as your user? Or in a console with admin privileges? |
I have tried both. pip install with both normal user and admin and also running Spyder as normal user and admin. All combinations. |
It shouldn't give an error if you installed Spyder-kernels as admin. But to be sure, you need to uninstall it first, be sure that it's really not present in your system, and then install it as admin. |
Behaviour seems inconsistent. I have tried this many, many times with various Python versions (admin & normal user) and it always complains that the spyder kernels are missing. I had one last go at it:
Weird... |
Problem description:
1- I am using Python 3.6 in the default environment (C:\Users\sedm6111\Anaconda3\envs\windturbine) and have created a new environment for Python 3.11 as I wanted to use it for certain libraries while maintaining my old Python version.
I have followed exactly the steps in (https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#the-modular-approach) but it didn't work, and I have also tried the solution in (https://stackoverflow.com/questions/28190500/virtualenv-ipython-in-spyder-not-working) and it didnt work.
The Python environment or installation whose interpreter is located at
C:\Users\sedm6111\Anaconda3\envs\mypy11env\python.exe
I get the below path when I run:
from jupyter_core import paths
paths.jupyter_runtime_dir()
C:\Users\sedm6111\AppData\Roaming\jupyter\runtime
I have tried a lot of lines to instal kernalls but non of them works:
pip install spyder‑kernels==1.9
pip install spyder‑kernels==1.9.*
pip install spyder‑kernels==2.0.*
The python -m spyder_kernels.console
0.01s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
NOTE: When using the
ipython kernel
entry point, Ctrl-C will not work.To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.
To read more about this, see ipython/ipython#2049
To connect another client to this kernel, use:
--existing kernel-51924.json
The error I get:
Your Python environment or installation doesn't have the spyder‑kernels module or the right version of it installed (>= 1.8.0 and < 2.0.0). 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
or
pip install spyder‑kernels
(mypy11env) C:\Users\sedm6111>pip list
Package Version
asttokens 2.4.1
cloudpickle 3.0.0
colorama 0.4.6
comm 0.2.1
debugpy 1.8.1
decorator 5.1.1
executing 2.0.1
ipykernel 6.29.3
ipython 8.22.2
jedi 0.19.1
jupyter_client 8.6.0
jupyter_core 5.7.1
matplotlib-inline 0.1.6
nest-asyncio 1.6.0
packaging 23.2
parso 0.8.3
pip 24.0
platformdirs 4.2.0
prompt-toolkit 3.0.43
psutil 5.9.8
pure-eval 0.2.2
Pygments 2.17.2
python-dateutil 2.9.0.post0
pywin32 306
pyzmq 25.1.2
setuptools 69.1.1
six 1.16.0
spyder-kernels 2.0.0
stack-data 0.6.3
tornado 6.4
traitlets 5.14.1
wcwidth 0.2.13
wheel 0.42.0
The text was updated successfully, but these errors were encountered: