pythonpython-3.xcolorama

Why is python 3 not recognizing colorama?


I'm on a Mac, trying to run a script with python3 that uses colorama, but I'm getting the error 'No module named colorama' despite doing pip install colorama several times. It works fine with python 2, but not python3. The colorama website seems to indicate it has been tested with python 3. Do I have something installed in the wrong place?

I've tried uninstalling and reinstalling colorama, as well as upgrading python to the latest version.

Traceback (most recent call last):
  File "sqftcalc.py", line 6, in <module>
    from colorama import init, Fore, Back, Style
ModuleNotFoundError: No module named 'colorama'

Solution

  • The solution for your answer is to install colorama for Python 3. To achieve this you can go to PyPi or install through pip.

    PyPi link : https://pypi.org/project/colorama/

    Command for installing through pip (Mentioning python3 since you are on a mac or linux) :

    python3 -m pip install colorama
    

    Colorama is a good tool for adding colored texts to the Terminal.