Repository navigation
Assertion failure on theme colour #14810
Copy link
Copy link
Closed
Milestone
Description
The iPython could not run on my PyCharm with the following error prompt:
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py", line 570, in <module>
pydevconsole.start_client(host, port)
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py", line 484, in start_client
interpreter = InterpreterInterface(threading.current_thread(), rpc_client=client)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_ipython_console.py", line 19, in __init__
self.interpreter = get_pydev_ipython_frontend(rpc_client)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 472, in get_pydev_ipython_frontend
_PyDevFrontEndContainer._instance = _PyDevIPythonFrontEnd(is_jupyter_debugger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 293, in __init__
self.ipython = self._init_ipy_app(PyDevTerminalInteractiveShell).shell
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 300, in _init_ipy_app
application.initialize(shell_cls)
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 258, in initialize
self.init_shell(shell_cls)
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 263, in init_shell
self.shell = shell_cls.instance()
^^^^^^^^^^^^^^^^^^^^
File "***/.venv/lib/python3.12/site-packages/traitlets/config/configurable.py", line 583, in instance
inst = cls(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 122, in __init__
super(PyDevTerminalInteractiveShell, self).__init__(*args, **kwargs)
File "***/.venv/lib/python3.12/site-packages/IPython/terminal/interactiveshell.py", line 977, in __init__
super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
File "***/.venv/lib/python3.12/site-packages/IPython/core/interactiveshell.py", line 627, in __init__
self.init_syntax_highlighting()
File "***/.venv/lib/python3.12/site-packages/IPython/core/interactiveshell.py", line 774, in init_syntax_highlighting
pyformat = PyColorize.Parser(theme_name=self.colors).format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "***/.venv/lib/python3.12/site-packages/IPython/utils/PyColorize.py", line 364, in __init__
assert theme_name == theme_name.lower()
AssertionError
Couldn't connect to console process.
Process finished with exit code 1
This only happens with version 9.0.0. It works fine with previous versions like 8.31.0.
The reason it failed was the theme_name being NoColor which were not all lower cases. This assertion appears on multiple locations inside the package.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
jkibele commentedon Mar 4, 2025
I also experienced this issue with pycharm and IPython 9.0.1, so it seems like the fix for #14808 did not fix this. I got around it by going back to 8.33.
lancelote commentedon Mar 4, 2025
PyCharm has
NoColorhardcoded. After a796b95 IPython expectsnocolor, hence the assertion error. I’ll fix it on PyCharm side. Should land in the 2025.1 release.OmriTreidel commentedon Mar 4, 2025
@lancelote It happens to me on python 3.12 pycharm professional 2024.3.1.1
mikelane commentedon Mar 4, 2025
Having this issue in
2024.3.4, so I tried upgrading to2025.1 EAP. Still have the issue. So I tried to downgrade to2024.2.5and that still has the same issue. I need to be able to debug something. Can someone suggest a workaround please, this is irritating.rkechols commentedon Mar 5, 2025
@mikelane there are workarounds posted here:
https://youtrack.jetbrains.com/issue/PY-79553/IPython-debugger-console-does-not-work-with-iPython-9
Carreau commentedon Mar 5, 2025
If someone send a PR that change the assert to a
if color in ...: color=color.lower()I'm happy to merge .SHi-ON commentedon Mar 5, 2025
For PyCharm users:
PY-79553 Support IPython 9+
PY-79553 Support IPython 9+
Carreau commentedon Mar 6, 2025
If someone send a PR that change the assert to a if color in (old themes names): color=color.lower() I'm happy to merge and make a point release.
PY-79553 Support IPython 9+
reaccept non lowercase colorscheme
reaccept non lowercase colorscheme (#14824)
Carreau commentedon Mar 8, 2025
closed by #14824