Unable to import termios package

saiki68 picture saiki68 · Aug 28, 2018 · Viewed 16.4k times · Source

I am using Python 3.7 and I need to import termios to mask a password input. But I am unable to find it on https://pypi.org/

import sys, tty, termios

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import sys, tty, termios
  File "C:\Python37\lib\tty.py", line 5, in <module>
    from termios import *
ModuleNotFoundError: No module named 'termios'

Answer

Adrian W picture Adrian W · Aug 28, 2018

https://docs.python.org/3/library/tty.html says:

Because it requires the termios module, it will work only on Unix.

i.e. there is no termios for Windows.