ValueError: Wrong color format 'dim'
Hey, I'm trying to use Euporie with Xonsh:
```xsh
# https://github.com/anki-code/xonsh-install
bash
TARGET_DIR=$HOME/.local/xonsh-env PYTHON_VER=3.12 XONSH_VER='git+https://github.com/xonsh/xonsh#egg=xonsh[full]' \
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/anki-code/xonsh-install/main/mamba-install-xonsh.sh)"
xonsh
xpip install jupyter euporie
xbin-add jupyter euporie-notebook # https://github.com/anki-code/xonsh-install
xpip list | grep -E 'euporie|prompt_toolkit|jupyter'
# euporie 2.10.1
# jupyter 1.1.1
# prompt_toolkit 3.0.48
# https://github.com/xonsh/xontrib-jupyter
xpip install xontrib-jupyter
xonfig jupyter-kernel --user
jupyter kernelspec list
# Available kernels:
# python3 /Users/pc/.local/xonsh-env/share/jupyter/kernels/python3
# xonsh /Users/pc/.local/xonsh-env/share/jupyter/kernels/xonsh
euporie-notebook --kernel-name xonsh
# or just
euporie-notebook
```
And I have this:
```xsh
14:18:05 CRITICAL Uncaught exception euporie.core.log.handle_exception:413 Traceback (most recent call last):
File "/Users/pc/.local/xonsh-env/xbin/euporie-notebook", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/euporie/notebook/__main__.py", line 10, in main
__main__.main(str(sys.modules[__name__].__package__).rpartition(".")[2])
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/euporie/core/__main__.py", line 36, in main
return entry.load().launch()
^^^^^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/euporie/core/app/app.py", line 542, in launch
result = app.run()
^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/application/application.py", line 1002, in run
return asyncio.run(coro)
^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/asyncio/base_events.py", line 686, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/euporie/core/app/app.py", line 413, in run_async
return await super().run_async(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/application/application.py", line 886, in run_async
return await _run_async(f)
^^^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/application/application.py", line 739, in _run_async
self._redraw()
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/application/application.py", line 543, in _redraw
self.context.copy().run(run_in_context)
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/application/application.py", line 526, in run_in_context
self.renderer.render(self, self.layout)
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/euporie/core/renderer.py", line 464, in render
self._cursor_pos, self._last_style = _output_screen_diff(
^^^^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/euporie/core/renderer.py", line 226, in _output_screen_diff
output_char(new_char)
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/euporie/core/renderer.py", line 115, in output_char
new_attrs = attrs_for_style_string[char.style]
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/renderer.py", line 285, in __missing__
attrs = self.get_attrs_for_style_str(style_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/styles/style.py", line 398, in get_attrs_for_style_str
return self._merged_style.get_attrs_for_style_str(style_str, default)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/styles/style.py", line 312, in get_attrs_for_style_str
inline_attrs = _parse_style_str(part)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/styles/style.py", line 172, in _parse_style_str
attrs = attrs._replace(color=parse_color(part))
^^^^^^^^^^^^^^^^^
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/prompt_toolkit/styles/style.py", line 76, in parse_color
raise ValueError(f"Wrong color format {text!r}")
ValueError: Wrong color format 'dim'
```
Please advice what I'm doing wrong?
Thanks!
关闭于 2025-12-15 3 条评论