{"id":309,"library":"tqdm","title":"tqdm: A Fast, Extensible Progress Bar for Python and CLI","description":"tqdm is a highly popular Python library that provides fast and extensible progress bars for loops and other iterable constructs. The name 'tqdm' is derived from the Arabic word 'taqaddum' (progress) and also stands for 'te quiero demasiado' (I love you so much). It seamlessly integrates with various Python libraries and environments, including Jupyter notebooks and command-line interfaces, allowing developers to easily monitor the progress of long-running tasks. The current stable version is 4.67.3, with frequent patch releases addressing bug fixes, performance enhancements, and compatibility updates.","status":"active","version":"4.67.3","language":"python","source_language":"en","source_url":"https://github.com/tqdm/tqdm","tags":["progress bar","cli","jupyter","visualization","utility","loop","data science"],"install":[{"cmd":"pip install tqdm","lang":"bash","label":"PyPI (Recommended)"},{"cmd":"conda install -c conda-forge tqdm","lang":"bash","label":"Conda"}],"dependencies":[{"reason":"For progress bars on DataFrame operations like `progress_apply` and `progress_map`.","package":"pandas","optional":true},{"reason":"Required for interactive progress bars in Jupyter notebooks (`tqdm.notebook`).","package":"ipywidgets","optional":true},{"reason":"For integration with `rich` beautiful terminal output (via `tqdm.rich`).","package":"rich","optional":true}],"imports":[{"note":"Importing `tqdm` as a module (`import tqdm`) requires using `tqdm.tqdm()` to wrap iterables, which is less common. Directly importing the `tqdm` function (`from tqdm import tqdm`) is the standard practice.","wrong":"import tqdm","symbol":"tqdm","correct":"from tqdm import tqdm"},{"note":"A convenient shortcut for `tqdm(range(N))`.","symbol":"trange","correct":"from tqdm import trange"},{"note":"For displaying rich, interactive progress bars within Jupyter Notebooks and other IPython environments. Requires `ipywidgets`.","symbol":"tqdm","correct":"from tqdm.notebook import tqdm"},{"note":"Automatically selects between console (`tqdm.tqdm`) and notebook (`tqdm.notebook`) progress bars based on the environment.","symbol":"tqdm","correct":"from tqdm.auto import tqdm"}],"quickstart":{"code":"import time\nfrom tqdm import tqdm\n\nfor i in tqdm(range(100), desc=\"Processing items\"): \n    time.sleep(0.05)\nprint(\"Done!\")\n\n# For pandas integration:\n# import pandas as pd\n# import numpy as np\n# from tqdm.auto import tqdm\n# tqdm.pandas()\n# df = pd.DataFrame(np.random.randint(0, 100, (100, 3)))\n# df.progress_apply(lambda x: x * 2)","lang":"python","description":"Wrap any iterable with `tqdm()` to instantly display a progress bar. For convenience with `range`, use `trange()`. For pandas DataFrames, register `tqdm.pandas()` and then use `progress_apply()` or `progress_map()`."},"warnings":[{"fix":"Always install `tqdm` using `pip install tqdm`. If you've installed `tdqm`, uninstall it with `pip uninstall tdqm`.","message":"The `tdqm` package (version 0.0.1) on PyPI is an alias for typos of `tqdm` and does not provide the actual `tqdm` functionality. Installing `tdqm` will not give you the progress bar library.","severity":"breaking","affected_versions":"All versions"},{"fix":"Always encapsulate your main code within a function and call it under an `if __name__ == \"__main__\":` guard to ensure correct process initialization.","message":"When using `tqdm` with Python's `multiprocessing` module, progress bars may not update correctly or can lead to 'endless loop of errors' if the multiprocessing pool is not properly initialized.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `from tqdm.notebook import tqdm` or `from tqdm.auto import tqdm` for Jupyter-specific, interactive widgets. Ensure `ipywidgets` is installed.","message":"In Jupyter Notebooks and similar interactive environments, progress bars might not update immediately due to output buffering.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update to `tqdm>=4.67.1` for fixes, but be aware that GUI integrations can be less stable than console/notebook bars. Consider alternative display methods if encountering persistent issues.","message":"The `gui` module (e.g., `tqdm.gui`) for Matplotlib GUI progress bars has experienced syntax fixes and is generally considered experimental.","severity":"deprecated","affected_versions":"<4.67.1"},{"fix":"If the total number of iterations is known, provide it as `tqdm(my_generator(), total=known_total)`. Otherwise, the bar will only show the count of completed iterations.","message":"If your iterable has an unknown length (e.g., a generator), `tqdm` cannot calculate percentage or estimated time unless the `total` parameter is explicitly provided.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade `tqdm` to version `4.66.3` or newer immediately.","message":"The `cli` module in versions prior to `v4.66.3` had an `eval` safety vulnerability (CVE-2024-34062, GHSA-g7vv-2v7x-gj9p).","severity":"breaking","affected_versions":"<4.66.3"}],"env_vars":null,"last_verified":"2026-05-12T12:59:24.462Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Correct the import statement to `from tqdm import tqdm` or `import tqdm`. Ensure you have installed the correct package: `pip install tqdm`.","cause":"You likely mistyped `tqdm` as `tdqm` in your import statement. While a `tdqm` package exists on PyPI, it's a placeholder for common typos and does not provide `tqdm`'s functionality.","error":"ModuleNotFoundError: No module named 'tdqm'"},{"fix":"Change your import to `from tqdm import tqdm` to directly import the function, or explicitly call `tqdm.tqdm(range(...))` if you prefer the module import.","cause":"When you use `import tqdm`, you're importing the `tqdm` *module*. The `tqdm` function itself is an attribute of this module.","error":"AttributeError: module 'tqdm' has no attribute 'tqdm' (when using `import tqdm` then `tqdm(range(...)))`"},{"fix":"For Jupyter: use `from tqdm.notebook import tqdm` (requires `ipywidgets`). For some cloud logging: set `TQDM_POSITION=-1` environment variable. Ensure the Python interpreter selected in your IDE matches where `tqdm` is installed.","cause":"Output buffering in certain environments (like Jupyter, VS Code integrated terminal, or cloud logs) can prevent `tqdm` from redrawing the progress bar in place.","error":"Progress bar does not update in Jupyter/VS Code/Cloud environment."},{"fix":"This issue might be resolved in newer `tqdm` versions. Update `tqdm` to the latest stable release. If the problem persists, it may be a known bug in the experimental `tqdm.rich` module, consider using standard `tqdm` or `tqdm.notebook` for stability.","cause":"This indicates an incompatibility or bug in how `tqdm`'s experimental `rich` integration handles the `reset()` method, specifically not passing a required `task_id` to `rich.progress.Progress.reset()`.","error":"TypeError: Progress.reset() missing 1 required positional argument: 'task_id' (specifically with `tqdm.rich` integration)"}],"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.14,"mem_mb":5.4,"disk_size":"18.3M"},{"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.1,"mem_mb":5.4,"disk_size":"19M"},{"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.2,"mem_mb":6.3,"disk_size":"20.2M"},{"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.15,"mem_mb":6.3,"disk_size":"21M"},{"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.17,"mem_mb":5.9,"disk_size":"12.1M"},{"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.17,"mem_mb":5.9,"disk_size":"13M"},{"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.14,"mem_mb":6,"disk_size":"11.7M"},{"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.2,"mem_mb":6,"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.12,"mem_mb":5.1,"disk_size":"17.8M"},{"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.1,"mem_mb":5.1,"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}]}}