How to Install threadpoolctl in Python
threadpoolctl
pip install threadpoolctl
What is threadpoolctl?
threadpoolctl
Python helpers to limit the number of threads used in the threadpool-backed of common native libraries used for scientific computing and data science (e.g. BLAS and OpenMP).
Fine control of the underlying thread-pool size can be useful in workloads that involve nested parallelism so as to mitigate oversubscription issues.
- For users, install the last published version from PyPI:
Quick Start
Minimal example to get started with threadpoolctl:
import threadpoolctl
print(threadpoolctl.__version__)
Installation
pip (standard)
pip install threadpoolctl
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install threadpoolctl
pip3
pip3 install threadpoolctl
conda
conda install -c conda-forge threadpoolctl
Poetry
poetry add threadpoolctl
Verify the Installation
After installing, confirm the package is available:
python -c "import threadpoolctl; print(threadpoolctl.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing threadpoolctl with pip.
ModuleNotFoundError: No module named 'threadpoolctl'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install threadpoolctl. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'threadpoolctl' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install threadpoolctl to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'threadpoolctl'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show threadpoolctl and upgrade with pip install --upgrade threadpoolctl.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install threadpoolctl. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user threadpoolctl
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org threadpoolctl
Recent Releases
| Version | Released |
|---|---|
3.6.0 latest |
2025-03-13 |
3.5.0 |
2024-04-29 |
3.4.0 |
2024-03-20 |
3.3.0 |
2024-02-14 |
3.2.0 |
2023-07-13 |
Manage threadpoolctl
Upgrade to latest version
pip install --upgrade threadpoolctl
Install a specific version
pip install threadpoolctl==3.6.0
Uninstall
pip uninstall threadpoolctl
Check what is installed
pip show threadpoolctl