QTile config: NameError: name 'Key' is not defined

hey guys, i switched to QTile today and ran into some issues. first, if i change my config and reboot, nothing changes, its still just the default configuration.

i looked into the logs (~/.local/share/qtile/qtile.log) and saw the following:

...
File "/nix/store/lybqp7di830dkslf2093skldjf0230-qtile.py", line 11, in <module>
    Key([mod], "Return", lazy.spawn(terminal), desc = "terminal"),
    ^^^
NameError: name 'Key' is not defined

here’s my complete QTile configuration:

from libqtile import bar, layout, qtile, widget
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy

mod = "mod4"
shift = "shift"
terminal = "terminator"

keys = [
    Key([mod], "Return", lazy.spawn(terminal), desc = "Terminal"),
    Key([mod], "x", lazy.window.kill(), desc = "Kill"),
    Key([mod], "space", lazy.next_layout(), desc = "switch layouts"),
    Key([mod], "q", lazy.reload_config(), desc = "reload config"),
    Key([mod], "p", lazy.spawncmd(), desc = "prompt launcher"),
]

groups = [
    Group(i) for i in "1234567890"
]

for i in groups:
    keys.extend([Key([mod], i.name, lazy.group[i.name].toscreen(), desc = "switch to group {}".format(i.name),),
                 Key([mod, shift], i.name, lazy.window.togroup(i.name), desc = "Move to group {}".format(i.name),),])

layouts = [
    layout.MonadTall(border_focus = "#1b5095", border_normal = "#343434", border_width = 1),
    layout.Max(border_focus = "#1b5095", border_normal = "#343434"),
    layout.Spiral(border_focus = "#1b5095", border_normal = "#343434"),
    layout.Floating(border_focus = "#1b5095", border_normal = "#343434")
]

widget_defaults = dict(
    font = "sans",
    fontsize = 10,
    padding = 3,
)

extension_defaults = widget_defaults.copy()

screens = [Screen(bottom = bar.Bar([
    widget.GroupBox(highlight_method = "line"),
    widget.Prompt(prompt = "> "),
    widget.WidgetBox(text_closed = "[ < ]", text_open = "[ > ]", widgets = [
        #widget.Battery(charge_controller: lambda (0, 95)),
        widget.Bluetooth(),
        widget.Wlan(),
        widget.Volume(emoji = True),
    ]),
    widget.MemoryGraph(border_width = 0, fill_color = "#026512", graph_color = "#015401", margin_x = 2, margin_y = 0),
    widget.CPUGraph(border_width = 0, margin_x = 2, margin_y = 0, fill_color = "#1667EB.3", graph_color = "#18BAEB"),
    widget.Systray(),
    widget.Clock(format = "%d.%m.%Y %I:%M %a"),
    widget.CurrentLayoutIcon(),
], 24,),),]

mouse = [
    Drag([mod], "Button1", lazy.window.set_position_floating(), start = lazy.window.get_position()),
    Drag([mod], "Button3", lazy.window.set_size_floating(), start = lazy.window.get_size()),
    Click([mod], "Button2", lazy.window.bing_to_front()),
]

dgroups_key_binder = None
dgroups_app_rules = []
follow_mouse_focus = True
bring_front_click = False
floats_kept_above = True
cursor_wrap = False
floating_layout = layout.Floating(floating_rules = [*layout.Floating.default_float_rules,])
auto_fillscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True

auto_minimize = False

wmname = "LG3D"

i dont know what to do here.

okey just have got some typos, now it works.