Open tobiasraabe opened 2 years ago
Hi, I had the same problem and could work around it only by modifying the environment. I set pytask back to 0.0.14. Then everything worked again.
Hi @vsondergeld, thank you for the confirmation and sorry for the inconvenience. v0.0.14 is pretty old. Which versions have you tested until you settled on this one? It could help me to track down the problem.
Yeah I assumed it was the oldest one possible since it said one needs >= 0.0.14. I had tried setting <0.2 before which gave me 0.1.9, but that didnt work. So I just went for the oldest one for now and have not systematically tried out those between. If I do this in the next days, I will let you know.
I tried to replicate the issue with an artificial and the project mentioned above. In a freshly set up environment, the issue does not occur anymore. Maybe a newer version of rich or some other dependency might have fixed the problem? Do you still experience the issue when you start with a new env, @vsondergeld? 🤞
I also have the same error occasionally (roughly every 15th-30th run).
Let me know if you need any further information.
Can you run python -m rich.diagnose as well? I am trying to get back to this issue after my vacation.
Sure, See here
╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮
│ A high level console interface. │
│ │
│ ╭──────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=120 ColorSystem.TRUECOLOR> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ color_system = 'truecolor' │
│ encoding = 'utf-8' │
│ file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│ height = 30 │
│ is_alt_screen = False │
│ is_dumb_terminal = False │
│ is_interactive = True │
│ is_jupyter = False │
│ is_terminal = True │
│ legacy_windows = False │
│ no_color = False │
│ options = ConsoleOptions( │
│ size=ConsoleDimensions(width=120, height=30), │
│ legacy_windows=False, │
│ min_width=1, │
│ max_width=120, │
│ is_terminal=True, │
│ encoding='utf-8', │
│ max_height=30, │
│ justify=None, │
│ overflow=None, │
│ no_wrap=False, │
│ highlight=None, │
│ markup=None, │
│ height=None │
│ ) │
│ quiet = False │
│ record = False │
│ safe_box = True │
│ size = ConsoleDimensions(width=120, height=30) │
│ soft_wrap = False │
│ stderr = False │
│ style = None │
│ tab_size = 8 │
│ width = 120 │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭── <class 'rich._windows.WindowsConsoleFeatures'> ───╮
│ Windows features available. │
│ │
│ ╭─────────────────────────────────────────────────╮ │
│ │ WindowsConsoleFeatures(vt=True, truecolor=True) │ │
│ ╰─────────────────────────────────────────────────╯ │
│ │
│ truecolor = True │
│ vt = True │
╰─────────────────────────────────────────────────────╯
╭────── Environment Variables ───────╮
│ { │
│ 'TERM': None, │
│ 'COLORTERM': None, │
│ 'CLICOLOR': None, │
│ 'NO_COLOR': None, │
│ 'TERM_PROGRAM': None, │
│ 'COLUMNS': None, │
│ 'LINES': None, │
│ 'JUPYTER_COLUMNS': None, │
│ 'JUPYTER_LINES': None, │
│ 'JPY_PARENT_PID': None, │
│ 'VSCODE_VERBOSE_LOGGING': None │
│ } │
╰────────────────────────────────────╯
platform="Windows"
I still had no time to further look into this issue. Apologies!
In the meantime, if you still experience this error, can you test this fix? Add these lines of code to some module that is imported somewhere in the beginning. For example, your project config.py
. Add
from pytask import console
console.legacy_windows = True
Thanks! I tested the fix. Unfortunately, I still get the error every few runs.
I get the error as well on my windows 11. I do not get it on my windows 10 computer. Suggested fixes do not work for me.
pytask 0.2.6 pyhd8ed1ab_0 conda-forge
pytask-latex 0.2.1 pyhd8ed1ab_0 conda-forge
pytask-r 0.2.0 pyhd8ed1ab_0 conda-forge
Can I ask you to list both environments and run python -m rich.diagnose
? I am sorry for the hassle, but I am really at a loss about what is causing this bug. Unfortunately, I don't have a machine/environment that is currently affected.
┌───────────────────────── <class 'rich.console.Console'> ─────────────────────────┐
│ A high level console interface. │
│ │
│ ┌──────────────────────────────────────────────────────────────────────────────┐ │
│ │ <console width=119 ColorSystem.WINDOWS> │ │
│ └──────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ color_system = 'windows' │
│ encoding = 'utf-8' │
│ file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│ height = 30 │
│ is_alt_screen = False │
│ is_dumb_terminal = False │
│ is_interactive = True │
│ is_jupyter = False │
│ is_terminal = True │
│ legacy_windows = True │
│ no_color = False │
│ options = ConsoleOptions( │
│ size=ConsoleDimensions(width=119, height=30), │
│ legacy_windows=True, │
│ min_width=1, │
│ max_width=119, │
│ is_terminal=True, │
│ encoding='utf-8', │
│ max_height=30, │
│ justify=None, │
│ overflow=None, │
│ no_wrap=False, │
│ highlight=None, │
│ markup=None, │
│ height=None │
│ ) │
│ quiet = False │
│ record = False │
│ safe_box = True │
│ size = ConsoleDimensions(width=119, height=30) │
│ soft_wrap = False │
│ stderr = False │
│ style = None │
│ tab_size = 8 │
│ width = 119 │
└──────────────────────────────────────────────────────────────────────────────────┘
┌─── <class 'rich._windows.WindowsConsoleFeatures'> ────┐
│ Windows features available. │
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │
│ └───────────────────────────────────────────────────┘ │
│ │
│ truecolor = False │
│ vt = False │
└───────────────────────────────────────────────────────┘
┌────── Environment Variables ───────┐
│ { │
│ 'TERM': None, │
│ 'COLORTERM': None, │
│ 'CLICOLOR': None, │
│ 'NO_COLOR': None, │
│ 'TERM_PROGRAM': None, │
│ 'COLUMNS': None, │
│ 'LINES': None, │
│ 'JPY_PARENT_PID': None, │
│ 'VSCODE_VERBOSE_LOGGING': None │
│ } │
└────────────────────────────────────┘
platform="Windows"
You are probably not running your powershell within Windows Terminal, aren't you? Could you try it with Windows Terminal https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=de-de&gl=de?
You are probably not running your powershell within Windows Terminal, aren't you? Could you try it with Windows Terminal https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=de-de&gl=de?
I ran it on cmd, but it does not make a difference (btw when I open windows terminal, it just opens a powershell tab, so not sure what this supposed to happen)
Windows Terminal gives the shells run inside more color support, character support, etc.. I thought this might help.
If someone could test this potential workaround, that would be awesome. Please, install rich=11.2 and try again. This is the last version without their win32 renderer released in v12 (https://github.com/Textualize/rich/releases/tag/v12.0.0).
Please, install rich=11.2 and try again.
Thanks for the idea! I tried it out and unfortunately got the same error again :/
A student of mine has the same problem. If I understand previous posters correctly, it occurs randomly and not too often. For my student it occurs each and every time. We made sure that the project itself runs on other computers. We tried PowerShell and AnacondaPrompt.
Here are some screenshots in case it helps:
Output of rich.diagnose
:
Error message:
I am sorry to hear that. What version of rich are you using? Is it Powershell 7 (blue) or Powershell Core? Have you tried running pwsh inside Terminal https://www.microsoft.com/store/apps/9n0dx20hk701?
I know that we did not run it inside Terminal, but I can't answer the other questions.
I'll inquire about the other things.
I ran into the same issue when I used pytask for the first time today. For me the error occurs every time as well. I tried the fixes mentioned above but none of them worked for me.
And the rich.diagnose:
I have the same issue on Windows 11 when I run pytask, both from VS code terminal and fromt the Anaconda shell. So far it has occured every time.
Code Sample, a copy-pastable example
Problem description
I don't know how this error can be reproduced, but it occurred
pytask -v0
Work-around
Run pytask in the Windows Subsystem for Linux (WSL).
Reports
To collect information on this issue, please report the packages in your environment and run
python -m rich.diagnose
.