prompt_toolkit.output.win32.NoConsoleScreenBufferError: No Windows console found. Are you running cmd.exe?
Opened this issue · 0 comments
neoking89 commented
Hi!
I am using this application for loading languagemodels and interacting with them in the terminal.
When I am working in Windows 11 and I reload several languagemodels, I get the following error:
File "c:\Users\.venv\Lib\site-packages\prompt_toolkit\application\application.py", line 300, in __init__
self.renderer = Renderer(
^^^^^^^^^
File "c:\Users\venv\Lib\site-packages\prompt_toolkit\renderer.py", line 325, in __init__
self.reset(_scroll=True)
File "c:\Users\.venv\Lib\site-packages\prompt_toolkit\renderer.py", line 351, in reset
self.output.scroll_buffer_to_prompt()
File "c:\Users\.venv\Lib\site-packages\prompt_toolkit\output\win32.py", line 339, in scroll_buffer_to_prompt
info = self.get_win32_screen_buffer_info()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\.venv\Lib\site-packages\prompt_toolkit\output\win32.py", line 191, in get_win32_screen_buffer_info
raise NoConsoleScreenBufferError
prompt_toolkit.output.win32.NoConsoleScreenBufferError: No Windows console found. Are you running cmd.exe?
Some interesting observations:
- The issue only seems to happen on Windows and not on Unix-systems
- The error interestingly doesnt to happen when I use the latest major version 2 (2.0.10), but does on 3.0.0.
I know python can be notorious for not returning all memory back to the user when working with bigger objects, so I figure this might seem to be related to the issue.
In my own code, I tried several ways to delete the bigger objects from memory. use del on everything in combination with gc.collect, but nothing seems to change this error aside from changing back to version 2