def config_inited(app, config):
    """Run during Sphinx `config-inited` phase.

    rtd reuses the environment, and there is no way to customize this behavior.
    Thus we remove the saved env.
    """
    pickle_file = os.path.join(app.doctreedir, ENV_PICKLE_FILENAME)
    if on_rtd and os.path.exists(pickle_file):
        os.remove(pickle_file)
Run during Sphinx `config-inited` phase.

    rtd reuses the environment, and there is no way to customize this behavior.
    Thus we remove the saved env.
    
docs/conf.py