{"id":23912,"library":"joblib-stubs","title":"joblib-stubs","description":"PEP 561 type stubs for joblib, providing type hints for joblib's core modules including Parallel, delayed, Memory, and dump/load. Current version is 1.5.3.1.20260117, compatible with joblib>=1.5.3.2 (cpython-only). Updated to track joblib releases, with occasional fixes for type accuracy.","status":"active","version":"1.5.3.1.20260117","language":"python","source_language":"en","source_url":"https://github.com/phi-friday/joblib-stubs","tags":["joblib","stubs","type-hints","type-checking","mypy"],"install":[{"cmd":"pip install joblib-stubs","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Stubs are for joblib; must be installed separately.","package":"joblib","optional":false}],"imports":[{"note":"joblib-stubs is a stub-only package; import directly from joblib.","wrong":"","symbol":"Parallel","correct":"from joblib import Parallel"},{"note":"Same as above; no separate stub import.","wrong":"","symbol":"delayed","correct":"from joblib import delayed"}],"quickstart":{"code":"from joblib import Parallel, delayed\n\nresults = Parallel(n_jobs=2)(delayed(lambda x: x**2)(i) for i in range(10))\nprint(results)","lang":"python","description":"Install joblib-stubs and use joblib normally; mypy or pyright will use the stubs for type checking."},"warnings":[{"fix":"Install both: `pip install joblib joblib-stubs`.","message":"joblib-stubs is a stub-only package. It does not contain joblib itself. You must install `joblib` separately.","severity":"gotcha","affected_versions":"all"},{"fix":"Check compatibility: `pip install joblib-stubs==$(python -c 'import joblib; print(joblib.__version__)')` or use constraints.","message":"The stubs are tied to specific joblib versions. Ensure the joblib-stubs version aligns with your installed joblib version (e.g., joblib-stubs 1.5.3.x expects joblib ~=1.5.3).","severity":"gotcha","affected_versions":">=1.5.0"},{"fix":"If you encounter type errors for advanced usage, consider adding inline `# type: ignore[arg-type]` and report issue to GitHub.","message":"Some stubs (e.g., `Memory`) may have incomplete type signatures. For instance, `joblib.Memory.__init__` might not perfectly reflect runtime default parameters.","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 joblib` to install the runtime package.","cause":"joblib-stubs installed but joblib itself is missing.","error":"Cannot find implementation or library stub for module named 'joblib'"},{"fix":"Ensure joblib >= 0.10; import using `from joblib import Parallel`.","cause":"Very old joblib version (pre-0.10) or import path wrong.","error":"Module 'joblib' has no attribute 'Parallel'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}