Python ‘termios’ Module Not Found (Easy Fix)

5/5 - (1 vote)

The termios module is a Python built-in module on Unix-like systems such as Linux, Ubuntu, and macOS.

See this part of the documentation that shows how it’s only focused on Unix systems:

How to Fix any Error: No Module Named 'termios'?

Because termios is part of the Python standard library on Unix operating systems, you can simply use it by specifying import termios in your Python shell. No need to manually install it with pip.

You can see in this image that termios is part of the Python Standard Library on all operating systems that supports it:

So, whenever it’s possible to use it, you can just import it in your Python script without needing to install it:

# On Linux/Ubuntu/macOS
import termios

Note that if you try to import the termios module from Windows, for example, it’ll rais the ModuleNotFoundError: No module named 'termios':

>>> import termios
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import termios
ModuleNotFoundError: No module named 'termios'

You may also get a note like this, depending on your concrete environment:

Could not find a version that satisfies the requirement termios (from versions: ) No matching distribution found for termios

But the reason is the same: you can only use termios in certain Unix-like operating systems. If it doesn’t work, you cannot use the module on the OS you’re currently on.

If you are on Linux and it still doesn’t work, it is likely that your Python installation is broken and you need to reinstall it as shown in this article.

Also, you may want to check out this article so you can see the current version of your termios package that may give some information about possibly outdated versioning:

🌍 Recommended Tutorial: How to Check β€˜termios’ Package Version in Python?