Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependency #11

Open
jupiterbjy opened this issue Aug 10, 2024 · 0 comments
Open

Missing dependency #11

jupiterbjy opened this issue Aug 10, 2024 · 0 comments

Comments

@jupiterbjy
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant