pre_spawn_hook
is Python code that runs in the Hub, not inside the user server environment. You probably want to follow this pattern to launch with a script that can do any initialization you want.
2 Likes