Skip to content

Missing dependency #11

@jupiterbjy

Description

@jupiterbjy

Using example from this repo:

#!/usr/bin/env python
from prompt_toolkit.application import Application
from prompt_toolkit.key_binding import KeyBindings, merge_key_bindings
from prompt_toolkit.key_binding.defaults import load_key_bindings
from prompt_toolkit.layout import HSplit, Layout, VSplit, Window
from prompt_toolkit.layout.controls import FormattedTextControl
from prompt_toolkit.styles import Style
from prompt_toolkit.widgets import TextArea
from ptterm import Terminal
def main():
style = Style(
[
("terminal focused", "bg:#aaaaaa"),
("title", "bg:#000044 #ffffff underline"),
]
)
term1 = Terminal()
text_area = TextArea(
text="Press Control-W to switch focus.\n"
"Then you can edit this text area.\n"
"Press Control-X to exit"
)
kb = KeyBindings()
@kb.add("c-w")
def _(event):
switch_focus()
@kb.add("c-x", eager=True)
def _(event):
event.app.exit()
def switch_focus():
"Change focus when Control-W is pressed."
if application.layout.has_focus(term1):
application.layout.focus(text_area)
else:
application.layout.focus(term1)
application = Application(
layout=Layout(
container=HSplit(
[
Window(
height=1,
style="class:title",
content=FormattedTextControl(
" Press Control-W to switch focus."
),
),
VSplit(
[
term1,
Window(style="bg:#aaaaff", width=1),
text_area,
]
),
]
),
focused_element=term1,
),
style=style,
key_bindings=merge_key_bindings(
[
load_key_bindings(),
kb,
]
),
full_screen=True,
mouse_support=True,
)
application.run()
if __name__ == "__main__":
main()

Traceback (most recent call last):
  File "E:\Programs\Jetbrains\Toolbox\PyCharm Professional\plugins\python\helpers\pydev\pydevd.py", line 1551, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Programs\Jetbrains\Toolbox\PyCharm Professional\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "E:\github\llama-in-one\testbed\prompt_toolkit_markdown_realtime_demo.py", line 82, in <module>
    main()
  File "E:\github\llama-in-one\testbed\prompt_toolkit_markdown_realtime_demo.py", line 21, in main
    term1 = Terminal()
            ^^^^^^^^^^
  File "C:\Users\jupiterbjy\AppData\Local\Programs\Python\Python312\Lib\site-packages\ptterm\terminal.py", line 226, in __init__
    self.terminal_control = _TerminalControl(
                            ^^^^^^^^^^^^^^^^^
  File "C:\Users\jupiterbjy\AppData\Local\Programs\Python\Python312\Lib\site-packages\ptterm\terminal.py", line 50, in __init__
    self.process = Process(
                   ^^^^^^^^
  File "C:\Users\jupiterbjy\AppData\Local\Programs\Python\Python312\Lib\site-packages\ptterm\process.py", line 72, in __init__
    self.terminal = create_terminal(command, before_exec_func=before_exec_func)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jupiterbjy\AppData\Local\Programs\Python\Python312\Lib\site-packages\ptterm\process.py", line 25, in create_terminal
    from .backends.win32 import Win32Terminal
  File "C:\Users\jupiterbjy\AppData\Local\Programs\Python\Python312\Lib\site-packages\ptterm\backends\win32.py", line 6, in <module>
    from yawinpty import Pty, SpawnConfig
ModuleNotFoundError: No module named 'yawinpty'

yawinpty is missing - seems like yawinpty module itself is gone in pypi?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions