Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.094s · 18.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.084s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
wait_for
✓ from wait_for import wait_for
Common mistake is to import 'wait' or 'wait_for' from other libraries like 'tenacity'.
TimedOutError
✓ from wait_for import TimedOutError
Import TimedOutError for timeouts.
Waits for a condition to be true, retrying every `delay` seconds until `timeout`. Returns (result, elapsed_time) on success, raises TimedOutError on timeout.
from wait_for import wait_for
import time
def check_condition():
# Replace with actual condition logic
return False
try:
result, elapsed = wait_for(check_condition, timeout=10, delay=1)
print('Success', result, elapsed)
except Exception as e:
print('Failed:', e)
Errors
Common errors & fixes
TypeError: 'float' object cannot be interpreted as an integer
Passing a float timeout value before version 1.1.0; older versions expected integer.
fixUpdate to wait-for 1.1.0+ (explicit float conversion) or ensure timeout is an integer.
ImportError: cannot import name 'wait_for' from 'wait_for'
Incorrect installation or missing package (typo in package name: wait-for vs wait_for).
fixInstall the correct package: `pip install wait-for` (note the hyphen).
wait_for() missing 1 required positional argument: 'func'
Calling `wait_for()` without a callable (the function to wait for).
fixPass a callable as the first argument: `wait_for(my_func, timeout=10)`.
Upgrade
Version history
1.2.0latest on PyPI · released Sep 29, 2021
Audit
Dependencies
No dependency data recorded yet.