close

[Solved] No module named ‘termcolor’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error No module named ‘termcolor’ in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How No module named ‘termcolor’ Error Occurs?

Today I get the following error No module named ‘termcolor’ in python.

How To Solve No module named ‘termcolor’ Error ?

  1. How To Solve No module named 'termcolor' Error ?

    To Solve No module named 'termcolor' Error My guess is that you probably have two versions of Python or downloaded the wrong module.

  2. No module named 'termcolor'

    To Solve No module named 'termcolor' Error My guess is that you probably have two versions of Python or downloaded the wrong module.

Solution 1

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.

Solution 2

The simplest way, if you already have termcolor installed to Python3.x and it still has problems when you use programs with #!/usr/bin/env python, is to just copy the termcolor.py file from /usr/lib/python3/dist-packages to /usr/lib/python2.x

Seriously, that’s it. No dependencies. Just copy and go.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read