No module named 'termcolor'
pip install termcolor
returns
C:\Users\admin>pip install termcolor
Requirement already satisfied: termcolor in c:\python27\lib\site-packages
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Not sure why I can't import this module? Here's the code.
from termcolor import colored
The Python "ModuleNotFoundError: No module named 'termcolor'" occurs when we forget to install the termcolor module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install termcolor command.
Type "cmd" in the search bar and hit Enter to open the command line. What is this? Type “ pip install termcolor ” (without quotes) in the command line and hit Enter again. This installs termcolor for your default Python installation.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With