{"id":293,"library":"colorama","title":"Colorama","description":"Colorama is a Python library that simplifies printing colored text and styles to the terminal, ensuring cross-platform compatibility, especially on Windows. The current version is 0.4.6, released on October 25, 2022. The library has a stable release cadence, with updates addressing compatibility and minor feature enhancements.","status":"active","version":"0.4.6","language":"python","source_language":"en","source_url":"https://github.com/tartley/colorama","tags":["terminal","color","cross-platform","text styling"],"install":[{"cmd":"pip install colorama","lang":"bash","label":"Install Colorama"}],"dependencies":[],"imports":[{"note":"Ensure to import 'init' for initializing Colorama.","symbol":"init","correct":"from colorama import init"},{"note":"Import 'Fore' to access foreground color constants.","symbol":"Fore","correct":"from colorama import Fore"},{"note":"Import 'Back' to access background color constants.","symbol":"Back","correct":"from colorama import Back"},{"note":"Import 'Style' to access text style constants.","symbol":"Style","correct":"from colorama import Style"}],"quickstart":{"code":"from colorama import init, Fore, Back, Style\n\ninit(autoreset=True)\n\nprint(Fore.RED + 'This is red text')\nprint(Back.GREEN + 'This has a green background')\nprint(Style.BRIGHT + 'This is bright text')\nprint('Back to normal text')","lang":"python","description":"Initialize Colorama with auto-reset and print colored and styled text."},"warnings":[{"fix":"Always call 'init()' at the start of your program to initialize Colorama.","message":"On Windows, failing to call 'init()' may result in ANSI escape sequences being displayed as raw text instead of colored output.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use 'init(autoreset=False)' if you prefer to manually reset styles.","message":"Using 'init(autoreset=True)' resets styles after each print statement, which may not be desired in all cases.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Test your application on target terminals to ensure consistent styling.","message":"Colorama's 'Style.DIM' may not be supported on all terminals, leading to inconsistent text appearance.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure Colorama is initialized before using it with other ANSI-based libraries.","message":"Combining Colorama with other ANSI-based libraries without proper initialization may lead to unexpected behavior.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'0.4.6':29 '2022':34 '25':33 'address':44 'cadenc':41 'color':10,51 'colorama':1,2 'compat':21,45 'cross':19,53 'cross-platform':18,52 'current':26 'enhanc':49 'ensur':17 'especi':22 'featur':48 'librari':6,36 'minor':47 'octob':32 'platform':20,54 'print':9 'python':5 'releas':30,40 'simplifi':8 'stabl':39 'style':13,56 'termin':16,50 'text':11,55 'updat':43 'version':27 'window':24","created_at":"2026-03-28T08:20:41.613900+00:00","updated_at":"2026-04-16T03:07:32.039957+00:00","problems":[{"fix":"Install the colorama package using pip: `pip install colorama` or `pip3 install colorama`. If using an IDE like VS Code, ensure the correct Python interpreter is selected that has colorama installed.","cause":"The colorama library is not installed in the Python environment you are currently using, or it was installed for a different Python version than the one executing your script.","error":"ModuleNotFoundError: No module named 'colorama'"},{"fix":"Ensure you are importing `init` directly, for example: `from colorama import init, Fore, Back, Style`. Alternatively, if you `import colorama`, you must call `colorama.init()`. Also, check that you don't have a local file named `colorama.py` conflicting with the installed package.","cause":"This error often occurs when `init` (or `Fore`, `Back`, `Style`) is not correctly imported from the `colorama` module, or there's a shadowing file named `colorama.py` in your project directory.","error":"AttributeError: module 'colorama' has no attribute 'init'"},{"fix":"Call `colorama.init()` at the beginning of your script. For persistent issues on Windows, especially older versions or specific terminals, explicitly pass `convert=True` to `init()`: `init(convert=True)`. As of Colorama 0.4.6, `just_fix_windows_console()` can also be used for minimal setup.","cause":"On Windows, Colorama typically needs to initialize itself to convert ANSI escape codes into native Windows console API calls. If `init()` is not called, or if the terminal environment (like some older PowerShell versions or certain IDE integrated terminals) doesn't fully support ANSI escape sequences by default, colors may not display.","error":"Colorama not working / no colors in Windows terminal / PowerShell / VS Code"},{"fix":"Correct the import statement to use the proper capitalization: `from colorama import Fore, Back, Style`.","cause":"This typically happens due to a case sensitivity error, where 'fore' is used instead of 'Fore' (or 'back' instead of 'Back', 'style' instead of 'Style'). Python imports are case-sensitive.","error":"ImportError: cannot import name 'Fore' from 'colorama'"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"0.4.6","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/tartley/colorama","docs":null,"changelog":null,"pypi":"https://pypi.org/project/colorama/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":"verified"}}