Setting up a Sky: bpy.context.world = None
If not set scene.world is None.  Simply set it, for example to a world named "World" with scene.world = bpy.data.worlds.get("World") , or create a new one.

import bpy

scene = bpy.context.scene

if scene.world is None:
    # create a new world
    new_world = bpy.data.worlds.new("New World")
    new_world.use_sky_paper = True
    scene.world = new_world