Install & Compatibility
Where this runs
tested against v8.4.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.500s · 30.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.448s · 31MB
26MB installed
● package 26MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Runner
✓ from mozrunner import Runner
✗ mozrunner.Runner
Most classes are top-level in the mozrunner package, not nested.
FirefoxRunner
✓ from mozrunner import FirefoxRunner
✗ from mozrunner.runners import FirefoxRunner
FirefoxRunner is exported directly from mozrunner; no submodule needed.
Create a Firefox profile, start the browser, wait, then stop.
from mozrunner import FirefoxRunner
from mozprofile import FirefoxProfile
profile = FirefoxProfile() # or use addons/prefs
runner = FirefoxRunner(binary='firefox', profile=profile)
runner.start()
print('Firefox started')
runner.wait(timeout=60)
runner.stop()
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mozrunner'
Package not installed or installed in a different virtual environment.
fixRun `pip install mozrunner` in the correct environment.
AttributeError: module 'mozrunner' has no attribute 'Runner'
Outdated installation (version <8.0.0) where Runner was in a submodule.
fixUpgrade: `pip install -U mozrunner`. Also check imports: use `from mozrunner import Runner`.
OSError: [Errno 2] No such file or directory: 'firefox'
The browser binary is not on PATH or the specified path is wrong.
fixPass the correct binary path: binary='/usr/bin/firefox' or use shutil.which('firefox'). Upgrade
Version history
8.4.0latest on PyPI · released Mar 26, 2026
Audit
Dependencies
mozprofilerequiredUsed internally to manage Firefox profiles.
mozprocessrequiredUsed to start/kill browser processes.
mozinforequiredProvides platform information for binary paths.
sixoptionalCompatibility layer for Python 2/3 (mostly deprecated usage).