I have a fresh installation of Spyder 6.0.0 (Flatpak version) on Linux Mint 21.3 Cinnamon. I created a virtual environment with venv. When I change the interpreter via “Preferences > Python interpreter > Use the following Python interpreter” to the one of the virtual environment, the IPython console shows this error:
`An error ocurred while starting the kernel
Traceback (most recent call last):
File "/app/lib/python3.11/site‑packages/spyder_kernels/console/__main__.py", line 24, in
start.main()
File "/app/lib/python3.11/site‑packages/spyder_kernels/console/start.py", line 154, in main
import_spydercustomize()
File "/app/lib/python3.11/site‑packages/spyder_kernels/console/start.py", line 41, in import_spydercustomize
import spydercustomize # noqa
^^^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site‑packages/spyder_kernels/customize/spydercustomize.py", line 19, in
from spyder_kernels.customize.spyderpdb import SpyderPdb
File "/app/lib/python3.11/site‑packages/spyder_kernels/customize/spyderpdb.py", line 22, in
from IPython.core.autocall import ZMQExitAutocall
File "/app/lib/python3.11/site‑packages/IPython/__init__.py", line 54, in
from .core.application import Application
File "/app/lib/python3.11/site‑packages/IPython/core/application.py", line 26, in
from IPython.core import release, crashhandler
File "/app/lib/python3.11/site‑packages/IPython/core/crashhandler.py", line 27, in
from IPython.core import ultratb
File "/app/lib/python3.11/site‑packages/IPython/core/ultratb.py", line 104, in
import stack_data
File "/app/lib/python3.11/site‑packages/stack_data/__init__.py", line 1, in
from .core import Source, FrameInfo, markers_from_ranges, Options, LINE_GAP, Line, Variable, RangeInLine,
File "/app/lib/python3.11/site‑packages/stack_data/core.py", line 16, in
from asttokens.util import Token
File "/app/lib/python3.11/site‑packages/asttokens/__init__.py", line 22, in
from .asttokens import ASTText, ASTTokens, supports_tokenless
File "/app/lib/python3.11/site‑packages/asttokens/asttokens.py", line 23, in
import six
ModuleNotFoundError: No module named 'six'
Traceback (most recent call last):
File "/usr/lib/python3.11/runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/runpy.py", line 88, in _run_code
exec(code, run_globals)
File "/app/lib/python3.11/site‑packages/spyder_kernels/console/__main__.py", line 24, in
start.main()
File "/app/lib/python3.11/site‑packages/spyder_kernels/console/start.py", line 154, in main
import_spydercustomize()
File "/app/lib/python3.11/site‑packages/spyder_kernels/console/start.py", line 41, in import_spydercustomize
import spydercustomize # noqa
^^^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site‑packages/spyder_kernels/customize/spydercustomize.py", line 19, in
from spyder_kernels.customize.spyderpdb import SpyderPdb
File "/app/lib/python3.11/site‑packages/spyder_kernels/customize/spyderpdb.py", line 22, in
from IPython.core.autocall import ZMQExitAutocall
File "/app/lib/python3.11/site‑packages/IPython/__init__.py", line 54, in
from .core.application import Application
File "/app/lib/python3.11/site‑packages/IPython/core/application.py", line 26, in
from IPython.core import release, crashhandler
File "/app/lib/python3.11/site‑packages/IPython/core/crashhandler.py", line 27, in
from IPython.core import ultratb
File "/app/lib/python3.11/site‑packages/IPython/core/ultratb.py", line 104, in
import stack_data
File "/app/lib/python3.11/site‑packages/stack_data/__init__.py", line 1, in
from .core import Source, FrameInfo, markers_from_ranges, Options, LINE_GAP, Line, Variable, RangeInLine,
File "/app/lib/python3.11/site‑packages/stack_data/core.py", line 16, in
from asttokens.util import Token
File "/app/lib/python3.11/site‑packages/asttokens/__init__.py", line 22, in
from .asttokens import ASTText, ASTTokens, supports_tokenless
File "/app/lib/python3.11/site‑packages/asttokens/asttokens.py", line 23, in
import six
ModuleNotFoundError: No module named 'six'`
Switching back to Spyder’s internal interpreter creates a working IPython console.
The Python version of the virtual environment is 3.10.12 (came with Linux mint), Spyder’s internal Python version is 3.11.9.
The ‘six’ module is importable without error within the activated virtual environment as well as in the IPython console using Spyder’s ‘internal’ interpreter.
Any ideas what is causing this error?
Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.