Typing stubs for invoke
raw JSON → 2.0.0.10 verified Fri May 01 auth: no python
Unofficial typing stubs for the invoke library, provided by typeshed. Version 2.0.0.10 supports Python 3.7+. These stubs allow type checkers to validate code using invoke, but they may lag behind the invoke library itself.
pip install types-invoke Common errors
error ModuleNotFoundError: No module named 'invoke' ↓
cause invoke runtime package is missing.
fix
Install invoke:
pip install invoke. error Import "invoke" could not be resolved from source ↓
cause Pylance/mypy cannot find stubs; types-invoke not installed.
fix
Run
pip install types-invoke. error No overloads for 'run' match arguments ↓
cause Stubs define 'run' differently from actual invoke version.
fix
Check invoke documentation for the correct signature, or update types-invoke.
Warnings
deprecated types-invoke is provided by typeshed and may be removed or replaced by stubs in the invoke package itself. ↓
fix Consider using `pip install invoke[types]` if available in the future, or rely on inline type hints.
gotcha Stubs may not cover all invoke features; some advanced patterns may not type-check correctly. ↓
fix Add `# type: ignore` comments or write custom stubs for unsupported features.
breaking Version 2.0.0.10 is not a standard semantic version; it follows typeshed's calendar versioning. This may confuse dependency resolvers. ↓
fix Pin to exact version: `types-invoke==2.0.0.10`.
Imports
- run
from invoke import run
Quickstart
from invoke import run
result = run('echo hello', hide=True)
print(result.stdout)