My guess is that you probably have two versions of Python or downloaded the wrong module.

1)Wrong Module:

pip install term color

It will install a different module. To fix it, install the correct module:

pip install termcolor

2)Two-Versions

If you have two versions of Python, you need to specify it:

i)Two versions of Python 3:

If you two versions of Python3, specify:

pip3.x install termcolor

ii)If you have Python 2 installed:

If you have Python 2 and 3 installed, specify it, as pip works for Python2, and pip3 works for Python 3:

pip3 install termcolor

If you have only Python3, or in simple words only one version of Python, You can follow the first instruction.

Answer from Mahir Islam on Stack Overflow
🌐
PyPI
pypi.org › project › termcolor
termcolor · PyPI
pip install termcolor Copy PIP instructions · python3 -m pip install --upgrade termcolor · git clone https://github.com/termcolor/termcolor cd termcolor python3 -m pip install . To see demo output, run: python3 -m termcolor ·
🌐
GitHub
github.com › termcolor › termcolor
GitHub - termcolor/termcolor: ANSI color formatting for output in terminal · GitHub
import sys from termcolor import colored, cprint text = colored("Hello, World!", "red", attrs=["reverse", "blink"]) print(text) cprint("Hello, World!", "green", "on_red") print_red_on_cyan = lambda x: cprint(x, "red", "on_cyan") print_red_on_cyan("Hello, World!") print_red_on_cyan("Hello, Universe!") for i in range(10): cprint(i, "magenta", end=" ") cprint("Attention!", "red", attrs=["bold"], file=sys.stderr) # You can also specify 0-255 RGB ints via a tuple cprint("Both foreground and background can use tuples", (100, 150, 250), (50, 60, 70))
🌐
GitHub
github.com › hfeeki › termcolor
GitHub - hfeeki/termcolor: fork of termcolor Python library · GitHub
import sys from termcolor import colored, cprint text = colored('Hello, World!', 'red', attrs=['reverse', 'blink']) print(text) cprint('Hello, World!', 'green', 'on_red') print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan') print_red_on_cyan('Hello, World!') print_red_on_cyan('Hello, Universe!') for i in range(10): cprint(i, 'magenta', end=' ') cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)
Author: hfeeki
🌐
Plain English
python.plainenglish.io › this-is-how-you-color-print-out-in-python-387b262f24f6
This is How You Color Print Out in Python | by Julio Souto | Python in Plain English
May 31, 2021 - from termcolor import coloredtry: int('Hello World') print(colored('Success!', 'green')) except Exception as E: print(colored(str(E), 'red'))
🌐
Arch Linux
archlinux.org › packages › extra › any › python-termcolor
Arch Linux - python-termcolor 3.3.0-1 (any)
View the file list for python-termcolor · View the soname list for python-termcolor · Copyright © 2002-2026 Judd Vinet, Aaron Griffin and Levente Polyák. The Arch Linux name and logo are recognized trademarks. Some rights reserved.
🌐
openSUSE
software.opensuse.org › package › python-termcolor
python-termcolor
ANSII Color formatting for output in terminal · Available text colors: grey, red, green, yellow, blue, magenta, cyan, white. Available text highlights: on_grey, on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white. Available attributes: bold, dark, underline, blink, reverse, ...
🌐
Finxter
blog.finxter.com › home › learn python blog › how to install termcolor in python?
How to Install termcolor in Python? - Be on the Right Side of Change
July 6, 2022 - To resolve this uncertainty, you can use pip3, which will always refer to your default Python 3 installation. ... Type “pip install termcolor” (without quotes), hit Enter.
Find elsewhere
🌐
GitHub
github.com › termcolor › termcolor › blob › main › README.md
termcolor/README.md at main · termcolor/termcolor
import sys from termcolor import colored, cprint text = colored("Hello, World!", "red", attrs=["reverse", "blink"]) print(text) cprint("Hello, World!", "green", "on_red") print_red_on_cyan = lambda x: cprint(x, "red", "on_cyan") print_red_on_cyan("Hello, World!") print_red_on_cyan("Hello, Universe!") for i in range(10): cprint(i, "magenta", end=" ") cprint("Attention!", "red", attrs=["bold"], file=sys.stderr) # You can also specify 0-255 RGB ints via a tuple cprint("Both foreground and background can use tuples", (100, 150, 250), (50, 60, 70))
Author: termcolor
🌐
GitHub
github.com › termcolor › termcolor › blob › main › src › termcolor › termcolor.py
termcolor/src/termcolor/termcolor.py at main · termcolor/termcolor
ANSI color formatting for output in terminal. Contribute to termcolor/termcolor development by creating an account on GitHub.
Author: termcolor
🌐
PyPI
pypi.python.org › pypi › termcolor › 2.0.1
termcolor · PyPI
import sys from termcolor import colored, cprint text = colored("Hello, World!", "red", attrs=["reverse", "blink"]) print(text) cprint("Hello, World!", "green", "on_red") print_red_on_cyan = lambda x: cprint(x, "red", "on_cyan") print_red_on_cyan("Hello, World!") print_red_on_cyan("Hello, Universe!") for i in range(10): cprint(i, "magenta", end=" ") cprint("Attention!", "red", attrs=["bold"], file=sys.stderr)
Published: Sep 12, 2022
Version: 2.0.1
🌐
Gentoo
packages.gentoo.org › packages › dev-python › termcolor
dev-python/termcolor – Gentoo Packages
ANSI Color formatting for output in terminal · https://github.com/termcolor/termcolor/
🌐
PyPI
pypi.org › project › termcolor-whl
termcolor-whl · PyPI
import sys from termcolor import colored, cprint text = colored('Hello, World!', 'red', attrs=['reverse', 'blink']) print(text) cprint('Hello, World!', 'green', 'on_red') print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan') print_red_on_cyan('Hello, World!') print_red_on_cyan('Hello, Universe!') for i in range(10): cprint(i, 'magenta', end=' ') cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)
🌐
Debian
packages.debian.org › sid › python3-termcolor
Debian -- Details of package python3-termcolor in sid
The termcolor Python module provides ANSII Color formatting for output in terminal.
🌐
PyPI
pypi.org › project › termcolor › 0.2
termcolor 0.2
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Cygwin
cygwin.com › packages › summary › python-termcolor-src.html
Cygwin Package Summary for python-termcolor (source)
Get that Linux feeling - on Windows · ANSII Color formatting for output in terminal
🌐
Indian AI Production
indianaiproduction.com › home › blog › how print colorful text in python | python tutorial
How print colorful text in Python | Python Tutorial
June 3, 2021 - # Import Libraries from termcolor import colored print("warning") print("Done") ### Text colors: warning = colored("warning", "red") done = colored("done", "green") print(f"[{warning}] Virus in running") print(f"[{done}] Virus killed") ### Text highlights: warning = colored("[warning]", "red", "on_grey") done = colored("[done]", "green", "on_grey") print(f"{warning} Virus in running") print() print(f"{done} Virus killed") ### Attributes warning = colored("[warning]", "red", "on_grey", attrs=['reverse']) done = colored("[done]", "green") print(f"{warning} Virus in running", end = "\n") print(f"
🌐
PyPI
pypi.org › project › termcolor-dg
termcolor-dg
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Netmanageit
blog.netmanageit.com › supply-chain-risk-in-python-termcolor-and-colorama-explained
Supply Chain Risk in Python: Termcolor and Colorama Explained
August 18, 2025 - What initially appeared to be a harmless update of the popular termcolor library instead proved to be a multi-stage malware operation capable of executing remote code. This blog article examines how simple trust in package names can be exploited, the mechanics of the attack, and what security teams can learn from this incident to strengthen their defenses. 2. Discovery of the Malicious Termncolor Package The incident began when a security researcher noticed unusual import behavior in a Python environment after installing termncolor.