NameError: name 'sys' is not defined when trying to use jupyterhub-idle-culler

Hello, I am trying to add jupyterhub-idle-culler to a jupyterhub (installed with pip3 install jupyterhub):

pip3 install jupyterhub-idle-culler

nano /etc/jupyterhub/

c.JupyterHub.load_roles = [
        "name": "jupyterhub-idle-culler-role",
        "scopes": [
            # "admin:users", # if using --cull-users
        # assignment of role's permissions to:
        "services": ["jupyterhub-idle-culler-service"],
[...] = [
        "name": "jupyterhub-idle-culler-service",
        "command": [
            "-m", "jupyterhub_idle_culler",
        # "admin": True,

But when I try to start Jupyterhub I have the error:

jupyterhub -f /etc/jupyterhub/

NameError: name 'sys' is not defined

Solved by adding import sys at the beginning of… not super elegant although…

if you write a python script that references modules such as sys, you do need to import them before using them. Maybe it’s not clear that is a regular Python script that’s being executed? The only thing that’s special about it is injecting a single c variable (or get_config()) to the namespace. Otherwise, all your standard practices for writing Python code should apply, including imports, etc.