{"id":24686,"library":"tbb-devel","title":"Intel oneAPI Threading Building Blocks (oneTBB)","description":"Intel oneAPI Threading Building Blocks (oneTBB) is a C++ library for parallel programming. The tbb-devel package provides Python bindings (via pybind11) to access TBB's parallel algorithms, concurrent containers, task scheduling, and flow graphs. Version 2023.0.0 is the latest stable release. Releases occur roughly yearly.","status":"active","version":"2023.0.0","language":"python","source_language":"en","source_url":"https://github.com/oneapi-src/oneTBB","tags":["parallel","multi-threading","concurrency","TBB","Intel","oneAPI"],"install":[{"cmd":"pip install tbb-devel","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used to build Python bindings","package":"pybind11","optional":true}],"imports":[{"note":"The correct symbol is parallel_for, not prefixed with tbb_","wrong":"from tbb import tbb_parallel_for","symbol":"parallel_for","correct":"from tbb import parallel_for"},{"note":"task_group is the high-level interface; task_group_context is low-level and not part of the Python API","wrong":"from tbb import task_group_context","symbol":"task_group","correct":"from tbb import task_group"}],"quickstart":{"code":"import os\nfrom tbb import parallel_for\n\ndef square(x):\n    return x * x\n\n# Parallel for loop\nresults = parallel_for(range(10), square)\nprint(list(results))","lang":"python","description":"Demonstrates a simple parallel_for call using the tbb module."},"warnings":[{"fix":"Ensure your code is tested with the specific tbb-devel version you deploy. Check the oneTBB release notes for C++ API changes.","message":"The tbb-devel package provides Python bindings for oneTBB, but the C++ library has breaking changes between major versions (e.g., TBB 2020 to 2021). The Python API may not be fully compatible across versions.","severity":"breaking","affected_versions":"all"},{"fix":"Replace task_scheduler_init with global_control. In Python: from tbb import global_control; ctrl = global_control(global_control.max_allowed_parallelism, nthreads)","message":"The tbb::task_scheduler_init class is deprecated. Use tbb::global_control to set the number of threads.","severity":"deprecated","affected_versions":">=2021.0"},{"fix":"Check the tbb module's exported symbols via dir(tbb) or refer to the C++ oneTBB documentation for available features.","message":"The Python tbb module is a thin wrapper around C++ TBB. It may not expose all C++ features, and some functions (e.g., flow graph) have limited or no Python bindings.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install tbb-devel","cause":"tbb-devel is not installed or the Python environment does not have it.","error":"ImportError: No module named tbb"},{"fix":"Import with: from tbb import parallel_for","cause":"The user tried to use parallel_for without importing it correctly.","error":"NameError: name 'parallel_for' is not defined"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}