{"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,"last_verified":"2026-05-12T12:53:45.831Z","next_check":"2026-06-26T00:00:00.000Z","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,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.4,"disk_size":"18.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":1.2,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.4,"disk_size":"19.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.02,"mem_mb":1.3,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.4,"disk_size":"11.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.03,"mem_mb":1.4,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.02,"mem_mb":0.9,"disk_size":"11.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.03,"mem_mb":1.4,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.4,"disk_size":"17.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.02,"mem_mb":1.2,"disk_size":"18M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}