Install & Compatibility
Where this runs
tested against v0.18.4 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.147s · 23.8MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 3.2s · import 0.125s · 24MB
22MB installed
● package 22MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
given, when, then
✓ from radish import given, when, then
These decorators are used to define step implementations in your Python files.
before, after
✓ from radish import before, after
These decorators are used to define hooks that run before or after features, scenarios, or steps.
world
✓ from radish import world
The 'world' object provides global context for configuration and utility functions. For scenario-specific data, use `scenario.context` instead of `world` to avoid state leakage.
main
✓ from radish import main
Used for programmatic execution of radish tests, typically for integration with other tools.
To get started with radish, you typically create a `.feature` file written in Gherkin syntax and a corresponding Python file (e.g., `radish/steps.py`) with step implementations. Then, you execute `radish` from your terminal, pointing to the feature file.
# 1. Create a feature file (e.g., calculator.feature):
# Feature: Simple Calculator
# In order to avoid silly mistakes
# As a math enthusiast
# I want to be able to add numbers
#
# Scenario: Add two numbers
# Given I have the number 5
# And I have the number 7
# When I add them
# Then the result should be 12
# 2. Create a step implementation file (e.g., radish/steps.py):
from radish import given, when, then, world
@given("I have the number {number:g}")
def have_number(step, number):
if not hasattr(world, 'numbers'):
world.numbers = []
world.numbers.append(number)
@when("I add them")
def add_numbers(step):
world.result = sum(world.numbers)
@then("the result should be {expected_result:g}")
def check_result(step, expected_result):
assert world.result == expected_result
# 3. Run from your terminal in the directory containing 'calculator.feature':
# radish calculator.feature
radish --version
Errors
Common errors & fixes
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1
This error or similar `lxml` related errors (e.g., `cannot find -lz`) often indicate missing C libraries like libxml2, libxslt1-dev, or zlib1g-dev required by `lxml`, which radish-bdd uses for XML reporting. This was a known issue, especially on Linux and older Windows installations.
fixOn Debian/Ubuntu: `sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev`. On other Linux distributions, use the equivalent package manager. For Windows, ensure all C++ build tools are installed or try updating `pip` and `lxml` itself: `pip install --upgrade pip lxml`.
radish.exceptions.RadishError: No step implementation found for step 'Given I have an unimplemented step'
A step defined in your `.feature` file does not have a matching Python function decorated with `@given`, `@when`, or `@then` in your step definition files.
fixImplement the missing step function in your `radish/steps.py` (or other step definition files). For example, for 'Given I have an unimplemented step', add `@given("I have an unimplemented step")\ndef have_unimplemented_step(step):\n pass`. Upgrade
Version history
0.18.4latest on PyPI · released Feb 24, 2026
Audit
Dependencies
Pythonrequiredradish-bdd requires Python 3. Older versions supported Python 2, but this is no longer the case.