pythonkernelinterpreterpython-3.11

Error while finding module specification for 'spyder_kernels.console' (ModuleNotFoundError: No module named 'spyder_kernels')


I just upgraded python from 3.10 to 3.11.2 If I check in a windows powershell it was successful and is now the default interpreter. However, when I try to change the interpreter in Spyder I get the following error:

C:\Program Files\Python311\pythonw.exe: Error while finding module specification for 'spyder_kernels.console' (ModuleNotFoundError: No module named 'spyder_kernels')

The kernels are installed, as you can see if I try to pip install spyder_kernels the message that all requirements are met like so:

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: spyder-kernels in c:\users\TE\appdata\roaming\python\python38\site-packages (2.4.3)
Requirement already satisfied: cloudpickle in c:\users\TE\appdata\roaming\python\python38\site-packages (from spyder-kernels) (2.2.1)
Requirement already satisfied: jupyter-client<9,>=7.4.9 in c:\users\TE\appdata\roaming\python\python38\site-packages (from spyder-kernels) (8.1.0)
Requirement already satisfied: ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1 in c:\users\TE\appdata\roaming\python\python38\site-packages (from spyder-kernels) (8.6.0)
Requirement already satisfied: pyzmq>=22.1.0 in c:\users\TE\appdata\roaming\python\python38\site-packages (from spyder-kernels) (25.0.2)
Requirement already satisfied: ipykernel<7,>=6.16.1 in c:\users\TE\appdata\roaming\python\python38\site-packages (from spyder-kernels) (6.17.0)
Requirement already satisfied: nest-asyncio in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipykernel<7,>=6.16.1->spyder-kernels) (1.5.6)
Requirement already satisfied: packaging in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipykernel<7,>=6.16.1->spyder-kernels) (23.1)
Requirement already satisfied: traitlets>=5.1.0 in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipykernel<7,>=6.16.1->spyder-kernels) (5.9.0)
Requirement already satisfied: matplotlib-inline>=0.1 in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipykernel<7,>=6.16.1->spyder-kernels) (0.1.6)
Requirement already satisfied: tornado>=6.1 in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipykernel<7,>=6.16.1->spyder-kernels) (6.2)
Requirement already satisfied: psutil in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipykernel<7,>=6.16.1->spyder-kernels) (5.9.4)
Requirement already satisfied: debugpy>=1.0 in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipykernel<7,>=6.16.1->spyder-kernels) (1.6.3)
Requirement already satisfied: pickleshare in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (0.7.5)
Requirement already satisfied: stack-data in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (0.6.0)
Requirement already satisfied: backcall in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (0.2.0)
Requirement already satisfied: jedi>=0.16 in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (0.18.1)
Requirement already satisfied: prompt-toolkit<3.1.0,>3.0.1 in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (3.0.32)
Requirement already satisfied: decorator in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (5.1.1)
Requirement already satisfied: colorama in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (0.4.6)
Requirement already satisfied: pygments>=2.4.0 in c:\users\TE\appdata\roaming\python\python38\site-packages (from ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (2.13.0)
Requirement already satisfied: python-dateutil>=2.8.2 in c:\users\TE\appdata\roaming\python\python38\site-packages (from jupyter-client<9,>=7.4.9->spyder-kernels) (2.8.2)
Requirement already satisfied: importlib-metadata>=4.8.3 in c:\users\TE\appdata\roaming\python\python38\site-packages (from jupyter-client<9,>=7.4.9->spyder-kernels) (5.0.0)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in c:\users\TE\appdata\roaming\python\python38\site-packages (from jupyter-client<9,>=7.4.9->spyder-kernels) (5.3.0)
Requirement already satisfied: zipp>=0.5 in c:\users\TE\appdata\roaming\python\python38\site-packages (from importlib-metadata>=4.8.3->jupyter-client<9,>=7.4.9->spyder-kernels) (3.10.0)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in c:\users\TE\appdata\roaming\python\python38\site-packages (from jedi>=0.16->ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (0.8.3)
Requirement already satisfied: platformdirs>=2.5 in c:\users\TE\appdata\roaming\python\python38\site-packages (from jupyter-core!=5.0.*,>=4.12->jupyter-client<9,>=7.4.9->spyder-kernels) (2.5.3)
Requirement already satisfied: pywin32>=300 in c:\users\TE\appdata\roaming\python\python38\site-packages (from jupyter-core!=5.0.*,>=4.12->jupyter-client<9,>=7.4.9->spyder-kernels) (305)
Requirement already satisfied: wcwidth in c:\users\TE\appdata\roaming\python\python38\site-packages (from prompt-toolkit<3.1.0,>3.0.1->ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (0.2.5)
Requirement already satisfied: six>=1.5 in c:\users\TE\appdata\roaming\python\python38\site-packages (from python-dateutil>=2.8.2->jupyter-client<9,>=7.4.9->spyder-kernels) (1.16.0)
Requirement already satisfied: executing>=1.2.0 in c:\users\TE\appdata\roaming\python\python38\site-packages (from stack-data->ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (1.2.0)
Requirement already satisfied: asttokens>=2.1.0 in c:\users\TE\appdata\roaming\python\python38\site-packages (from stack-data->ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (2.1.0)
Requirement already satisfied: pure-eval in c:\users\TE\appdata\roaming\python\python38\site-packages (from stack-data->ipython!=8.10.0,!=8.8.0,!=8.9.0,<9,>=7.31.1->spyder-kernels) (0.2.2)
Note: you may need to restart the kernel to use updated packages.

I further tried installing a specific spyder_kernel==2.4.3 but then I get the message

pip install spyder-kernels==2.4.3
[autoreload of jupyter_client.asynchronous.client failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: _() requires a code object with 2 free vars, not 0
]
[autoreload of jupyter_client.provisioning.provisioner_base failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 349, in update_class
    return False
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 307, in update_instances
    pass # skip non-writable attributes
TypeError: can't apply this __setattr__ to KernelProvisionerMeta object
]
[autoreload of jupyter_client.manager failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: client() requires a code object with 1 free vars, not 0
]
[autoreload of IPython.core.debugger failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: precmd() requires a code object with 1 free vars, not 0
]
[autoreload of IPython.core.interactiveshell failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 459, in superreload
    to new versions when 'xxx' is reloaded.
  File "C:\Program Files\Python38\lib\importlib\__init__.py", line 169, in reload
    _bootstrap._exec(spec, module)
  File "<frozen importlib._bootstrap>", line 604, in _exec
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\core\interactiveshell.py", line 93, in <module>
    from IPython.utils.contexts import NoOpContext
ImportError: cannot import name 'NoOpContext' from 'IPython.utils.contexts' (C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\utils\contexts.py)
]
[autoreload of IPython.core.completer failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: __init__() requires a code object with 1 free vars, not 0
]
[autoreload of IPython.terminal.magics failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: autoindent() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.auto failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: automagic() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.basic failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: alias_magic() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.code failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: save() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.config failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: config() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.display failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: js() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.execution failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: prun() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.extension failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: load_ext() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.history failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: history() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.logging failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: logstart() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.namespace failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: pinfo() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.osm failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: alias() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.packaging failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: pip() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.pylab failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: matplotlib() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.core.magics.script failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: shebang() requires a code object with 0 free vars, not 5
]
[autoreload of IPython.extensions.storemagic failed: Traceback (most recent call last):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 261, in check
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 484, in superreload
    self._reloader.enabled = True
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 333, in update_class
    update_class),
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 381, in update_generic
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 293, in update_function
    continue
ValueError: store() requires a code object with 0 free vars, not 5
]


Windows fatal exception: stack overflow


Main thread:
Current thread 0x00003430 (most recent call first):
  File "C:\Users\TE\AppData\Roaming\Python\Python38\site-packages\IPython\extensions\autoreload.py", line 364 in <lambda>...

There is a list of other .py files here that I had to delete as the thread is too long.

Restarting kernel...

I'm not sure what to do now. Any ideas?


Solution

  • Ok. So what's happening is pip is trying to install spyder_kernels to Python 3.8, as that is the first version listed in PATH (Windows uses this to find where your interpreter is). What pip is doing is it's checking if spyder-kernels is installed for Python 3.8, not 3.11.

    Try typing this: C:\Users\TE\AppData\Roaming\Python\Python311\python.exe -m pip install spyder-kernels or C:\Program Files\Python311\python.exe -m pip install spyder-kernels Or go to System Properties>Enviromental Variables>Click Path>Edit, then move ...\Python311\Scripts and ...\Python311 to the top. Change PATH

    Let me know if this helps