acoustic-carpenter-78188
03/24/2026, 4:58 PMenv_train = flyte.TaskEnvironment(name="training", image=env_train_image)
env_data = flyte.TaskEnvironment(name="data-prep", image=env_data_image, depends_on=[env_train])
flyte.deploy(env_data, copy_style="none", version="3.0.0")
will deploy both.
flyte.deploy(env_data, copy_style="none", version="3.0.0")
flyte.deploy(env_train, copy_style="none", version="3.0.0")
also works. but
flyte.deploy(env_data, env_train, copy_style="none", version="3.0.0")
gives:
ValueError: Environment 'training' is defined in '/Users/danielsola/repos/multi_image_repro/v2_guide/remote_builder/main.py' but was imported twice under different module names ('__main__' and '__main__'). This is usually caused by running `flyte deploy` from the project root of a src/ layout project without --root-dir. Try adding --root-dir src (or your source root directory)
I think that we should be able to accommodate this pattern by adding _check_duplicate_env to each env in plan_deploy
flyteorg/flyte-sdkacoustic-carpenter-78188
03/25/2026, 8:11 PM