How to Install Colorama in Python

How to install Colorama in Python?

Python packages are installed using setup.py by entering the following command from a command line:

python setup.py install

Why is python 3 not recognizing colorama?

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.

Trouble installing colorama

I don't know if you still need help for this but I had the same problem and managed to solve it.

I just went into cmd and put:

pip install colorama --user

and it worked for me (new to coding and python so I've got 3.8.3 and have had similar issues with several pip installs).

Can't import the colorama module

Have you installed it correctly? Install colorama by typing pip install colorama in command prompt

Then try reloading / restarting your VS Code.

Check if the selected python interpreter in VSCode is the same as the one you installed coloroma. You can check by typing where python in command prompt and it will tell you the location.

Get-Command python if you are in Windows Powershell, or type which python in Mac

Why pip install colorama~=0.3 installs colorama-0.4.0

The operator ~= means "compatible release". When using semantic versioning a compatible version is such that the first number in the sequence is the same (number 0 in this case).

From the link above:

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner,
and PATCH version when you make backwards-compatible bug fixes.



Related Topics



Leave a reply



Submit