本文介绍了asciinema缺少文件:ImportError:没有名为"termios"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行asciinema rec时,asciinema.exe都从C:\Python34\Scripts内部运行,这是pip命令在git bash中唯一起作用的地方.

$ asciinema.exe
Traceback (most recent call last):
  File "c:\Python34\Scripts\asciinema-script.py", line 9, in <module>
    load_entry_point('asciinema==0.9.8', 'console_scripts', 'asciinema')()
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 353, in load_entry
_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 2302, in load_entr
y_point
    return ep.load()
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 2029, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "C:\Python34\lib\site-packages\asciinema\__main__.py", line 4, in <module
>
    from .commands.builder import get_command
  File "C:\Python34\lib\site-packages\asciinema\commands\builder.py", line 4, in
 <module>
    from .record import RecordCommand
  File "C:\Python34\lib\site-packages\asciinema\commands\record.py", line 4, in
<module>
    from asciinema.recorder import Recorder
  File "C:\Python34\lib\site-packages\asciinema\recorder.py", line 5, in <module
>
    from .pty_recorder import PtyRecorder
  File "C:\Python34\lib\site-packages\asciinema\pty_recorder.py", line 2, in <mo
dule>
    import pty
  File "C:\Python34\lib\pty.py", line 11, in <module>
    import tty
  File "C:\Python34\lib\tty.py", line 5, in <module>
    from termios import *
ImportError: No module named 'termios'
解决方案

不支持Windows,因为它不具有伪终端,select()和其他unix功能.安装Cygwin也无济于事,因为它也不支持类似UNIX的伪终端.

另请参阅: Windows等同于sys/select.h和termios.h 中定义的功能? /p>


解决方法

  • 您可以尝试 mattn/asciinema 分支(windows分支). /li>
  • Docker容器中运行它.
  • 在asciinemarel ="nofollow noreferrer"> Ubuntu for Windows中的Bash终端

When running asciinema rec, asciinema.exe both from inside C:\Python34\Scripts which is the only place the pip command works in git bash.

$ asciinema.exe
Traceback (most recent call last):
  File "c:\Python34\Scripts\asciinema-script.py", line 9, in <module>
    load_entry_point('asciinema==0.9.8', 'console_scripts', 'asciinema')()
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 353, in load_entry
_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 2302, in load_entr
y_point
    return ep.load()
  File "C:\Python34\lib\site-packages\pkg_resources.py", line 2029, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "C:\Python34\lib\site-packages\asciinema\__main__.py", line 4, in <module
>
    from .commands.builder import get_command
  File "C:\Python34\lib\site-packages\asciinema\commands\builder.py", line 4, in
 <module>
    from .record import RecordCommand
  File "C:\Python34\lib\site-packages\asciinema\commands\record.py", line 4, in
<module>
    from asciinema.recorder import Recorder
  File "C:\Python34\lib\site-packages\asciinema\recorder.py", line 5, in <module
>
    from .pty_recorder import PtyRecorder
  File "C:\Python34\lib\site-packages\asciinema\pty_recorder.py", line 2, in <mo
dule>
    import pty
  File "C:\Python34\lib\pty.py", line 11, in <module>
    import tty
  File "C:\Python34\lib\tty.py", line 5, in <module>
    from termios import *
ImportError: No module named 'termios'
解决方案

Windows is not supported as it doesn't have pseudo-terminal, select() and other unix capabilities. Installing Cygwin won't help either as it doesn't support UNIX-like pseudo-terminal as well.

See also: What is the Windows equivalent to the capabilities defined in sys/select.h and termios.h


Workarounds

这篇关于asciinema缺少文件:ImportError:没有名为"termios"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-17 08:58