From f387f1312f05c0fe21d99e3df3d3f026bc9aff31 Mon Sep 17 00:00:00 2001 From: John Agapiou Date: Thu, 13 Jul 2023 04:07:42 -0700 Subject: [PATCH] Make meltingpot/python the root package. Instead of `from meltingpot.python.x import y` you should now just use `from meltingpot.x import y`. PiperOrigin-RevId: 547748440 Change-Id: Iddb6254e0eccf38229e202ef34a6f980818ac4ff --- docs/substrate_tutorial/index.md | 20 ++--- examples/pettingzoo/sb3_train.py | 4 +- examples/pettingzoo/utils.py | 4 +- examples/rllib/self_play_train.py | 4 +- examples/rllib/tests/test_environment.py | 6 +- examples/rllib/utils.py | 7 +- examples/rllib/view_models.py | 2 +- .../configs/environment/harvest_finished.py | 2 +- examples/tutorial/harvest/play_harvest.py | 4 +- meltingpot/python/__init__.py | 6 +- meltingpot/python/bot.py | 16 ++-- meltingpot/python/bot_test.py | 4 +- meltingpot/python/configs/bots/__init__.py | 21 +++-- .../python/configs/bots/bot_configs_test.py | 4 +- .../scenarios/scenario_configs_test.py | 8 +- .../substrates/allelopathic_harvest.py | 8 +- .../substrates/allelopathic_harvest__open.py | 2 +- ...bach_or_stravinsky_in_the_matrix__arena.py | 10 +-- ...h_or_stravinsky_in_the_matrix__repeated.py | 10 +-- .../python/configs/substrates/boat_race.py | 6 +- .../substrates/boat_race__eight_races.py | 2 +- .../chemistry__three_metabolic_cycles.py | 8 +- ...bolic_cycles_with_plentiful_distractors.py | 8 +- .../chemistry__two_metabolic_cycles.py | 8 +- ...__two_metabolic_cycles_with_distractors.py | 8 +- .../chicken_in_the_matrix__arena.py | 10 +-- .../chicken_in_the_matrix__repeated.py | 8 +- .../python/configs/substrates/clean_up.py | 8 +- meltingpot/python/configs/substrates/coins.py | 8 +- .../substrates/collaborative_cooking.py | 8 +- .../collaborative_cooking__asymmetric.py | 4 +- .../collaborative_cooking__circuit.py | 4 +- .../collaborative_cooking__cramped.py | 4 +- .../collaborative_cooking__crowded.py | 4 +- .../collaborative_cooking__figure_eight.py | 4 +- .../collaborative_cooking__forced.py | 4 +- .../substrates/collaborative_cooking__ring.py | 4 +- .../substrates/commons_harvest__closed.py | 6 +- .../substrates/commons_harvest__open.py | 6 +- .../commons_harvest__partnership.py | 6 +- .../python/configs/substrates/coop_mining.py | 6 +- .../python/configs/substrates/daycare.py | 6 +- .../substrates/externality_mushrooms.py | 8 +- .../externality_mushrooms__dense.py | 4 +- .../configs/substrates/factory_commons.py | 6 +- .../substrates/factory_commons__either_or.py | 6 +- .../python/configs/substrates/fruit_market.py | 4 +- .../fruit_market__concentric_rivers.py | 4 +- .../configs/substrates/gift_refinements.py | 6 +- .../configs/substrates/hidden_agenda.py | 4 +- .../substrates/paintball__capture_the_flag.py | 4 +- .../substrates/paintball__king_of_the_hill.py | 4 +- .../configs/substrates/predator_prey.py | 6 +- .../substrates/predator_prey__alley_hunt.py | 4 +- .../configs/substrates/predator_prey__open.py | 4 +- .../substrates/predator_prey__orchard.py | 4 +- .../predator_prey__random_forest.py | 6 +- .../prisoners_dilemma_in_the_matrix__arena.py | 10 +-- ...isoners_dilemma_in_the_matrix__repeated.py | 8 +- .../pure_coordination_in_the_matrix__arena.py | 10 +-- ...re_coordination_in_the_matrix__repeated.py | 8 +- ...zable_coordination_in_the_matrix__arena.py | 10 +-- ...le_coordination_in_the_matrix__repeated.py | 8 +- .../substrates/reaction_graph_utils.py | 2 +- ...ning_with_scissors_in_the_matrix__arena.py | 10 +-- ...g_with_scissors_in_the_matrix__one_shot.py | 8 +- ...g_with_scissors_in_the_matrix__repeated.py | 8 +- .../stag_hunt_in_the_matrix__arena.py | 10 +-- .../stag_hunt_in_the_matrix__repeated.py | 8 +- .../python/configs/substrates/territory.py | 8 +- .../substrates/territory__inside_out.py | 6 +- .../configs/substrates/territory__open.py | 4 +- .../configs/substrates/territory__rooms.py | 4 +- .../python/configs/substrates/the_matrix.py | 2 +- .../human_players/level_playing_utils.py | 2 +- .../play_allelopathic_harvest.py | 4 +- .../play_anything_in_the_matrix.py | 32 ++++---- .../python/human_players/play_boat_race.py | 6 +- .../python/human_players/play_chemistry.py | 10 +-- .../python/human_players/play_clean_up.py | 4 +- meltingpot/python/human_players/play_coins.py | 4 +- .../play_collaborative_cooking.py | 16 ++-- .../human_players/play_commons_harvest.py | 8 +- .../python/human_players/play_coop_mining.py | 4 +- .../python/human_players/play_daycare.py | 4 +- .../play_externality_mushrooms.py | 4 +- .../human_players/play_factory_commons.py | 4 +- .../python/human_players/play_fruit_market.py | 4 +- .../human_players/play_gift_refinements.py | 4 +- .../human_players/play_hidden_agenda.py | 4 +- .../python/human_players/play_level_test.py | 80 +++++++++---------- .../python/human_players/play_paintball.py | 6 +- .../human_players/play_predator_and_prey.py | 10 +-- .../python/human_players/play_territory.py | 8 +- meltingpot/python/scenario.py | 12 +-- meltingpot/python/scenario_test.py | 4 +- meltingpot/python/substrate.py | 6 +- meltingpot/python/substrate_test.py | 4 +- meltingpot/python/testing/bots.py | 2 +- meltingpot/python/testing/mocks.py | 8 +- meltingpot/python/testing/mocks_test.py | 8 +- .../python/utils/evaluation/evaluation.py | 12 +-- .../utils/evaluation/evaluation_test.py | 2 +- .../utils/policies/fixed_action_policy.py | 2 +- .../python/utils/policies/policy_factory.py | 2 +- .../python/utils/policies/puppet_policy.py | 4 +- .../utils/policies/saved_model_policy.py | 4 +- .../python/utils/puppeteers/alternator.py | 2 +- .../utils/puppeteers/alternator_test.py | 4 +- .../python/utils/puppeteers/clean_up.py | 2 +- .../python/utils/puppeteers/clean_up_test.py | 4 +- meltingpot/python/utils/puppeteers/coins.py | 2 +- .../python/utils/puppeteers/coins_test.py | 4 +- .../puppeteers/coordination_in_the_matrix.py | 2 +- .../coordination_in_the_matrix_test.py | 6 +- .../python/utils/puppeteers/fixed_goal.py | 2 +- .../utils/puppeteers/fixed_goal_test.py | 4 +- .../utils/puppeteers/gift_refinements.py | 2 +- .../utils/puppeteers/gift_refinements_test.py | 4 +- .../python/utils/puppeteers/in_the_matrix.py | 2 +- .../utils/puppeteers/in_the_matrix_test.py | 4 +- .../running_with_scissors_in_the_matrix.py | 2 +- ...unning_with_scissors_in_the_matrix_test.py | 6 +- .../python/utils/puppeteers/testutils.py | 2 +- .../python/utils/scenarios/population.py | 2 +- meltingpot/python/utils/scenarios/scenario.py | 8 +- .../utils/scenarios/scenario_factory.py | 8 +- .../python/utils/scenarios/scenario_test.py | 8 +- meltingpot/python/utils/substrates/builder.py | 6 +- .../python/utils/substrates/builder_test.py | 4 +- .../utils/substrates/game_object_utils.py | 4 +- .../substrates/game_object_utils_test.py | 2 +- .../utils/substrates/reaction_graph_utils.py | 4 +- .../python/utils/substrates/shapes_test.py | 2 +- .../python/utils/substrates/substrate.py | 14 ++-- .../utils/substrates/substrate_factory.py | 4 +- .../python/utils/substrates/substrate_test.py | 4 +- .../utils/substrates/wrappers/base_test.py | 2 +- .../wrappers/collective_reward_wrapper.py | 2 +- .../collective_reward_wrapper_test.py | 2 +- .../wrappers/discrete_action_wrapper.py | 2 +- .../wrappers/discrete_action_wrapper_test.py | 2 +- .../wrappers/multiplayer_wrapper.py | 2 +- .../wrappers/multiplayer_wrapper_test.py | 2 +- .../utils/substrates/wrappers/observables.py | 2 +- .../wrappers/observables_wrapper.py | 2 +- .../wrappers/observables_wrapper_test.py | 2 +- .../substrates/wrappers/reset_wrapper.py | 2 +- setup.py | 16 ++-- 149 files changed, 466 insertions(+), 464 deletions(-) diff --git a/docs/substrate_tutorial/index.md b/docs/substrate_tutorial/index.md index a5adc5f2..335ffe33 100644 --- a/docs/substrate_tutorial/index.md +++ b/docs/substrate_tutorial/index.md @@ -10,7 +10,7 @@ By the end, your game will look like this: ## Getting started -The code for this tutorial is in `meltingpot/docs/substrate_tutorial`, and you +The code for this tutorial is in `meltingpot/examples/tutorial/harvest`, and you can try it out like this:
@@ -30,7 +30,7 @@ UnboundLocalError: local variable 'game_display' referenced before assignment
 ```
 
 make sure you are including the `-- --observation WORLD.RGB` parameter in your
-command. The reson for this is that the empty substrate only has two
+command. The reason for this is that the empty substrate only has two
 observations: `WORLD.RGB` and `WORLD.TEXT`. We will add more later on, including
 the default per-player `RGB` one.
 
@@ -38,17 +38,17 @@ the default per-player `RGB` one.
 
 If you just want to skip ahead and look at the finished game, simply change the
 import in
-[`play_harvest.py`](https://github.com/deepmind/meltingpot/tree/main/meltingpot/substrate_tutorial/harvest/play_harvest.py)
+[`play_harvest.py`](https://github.com/deepmind/meltingpot/tree/main/meltingpot/examples/tutorial/harvest/play_harvest.py)
 from
 
 ```python
-from meltingpot.tutorial.harvest.configs.environment import harvest as game
+from .configs.environment import harvest as game
 ```
 
 to
 
 ```python
-from meltingpot.tutorial.harvest.configs.environment import harvest_finished as game
+from .configs.environment import harvest_finished as game
 ```
 
 and launch as desired:
@@ -72,7 +72,7 @@ us, at least, have an avatar that we can move around.
 
 The first thing to do is to set our number of players to 1 and add the
 individual observation to the config in
-[`harvest.py`](https://github.com/deepmind/meltingpot/tree/main/meltingpot/substrate_tutorial/harvest/configs/environment/harvest.py):
+[`harvest.py`](https://github.com/deepmind/meltingpot/tree/main/meltingpot/examples/tutorial/harvest/configs/environment/harvest.py):
 
 ```python
   config.num_players = 1
@@ -209,7 +209,7 @@ the `lab2d_settings` part of the config. In the end, they should look like this:
   config.substrate.lab2d_settings = {
       "levelName": "harvest",
       "levelDirectory":
-          "meltingpot/substrate_tutorial/harvest/levels",
+          "meltingpot/examples/tutorial/harvest/levels",
       "maxEpisodeLengthFrames": 100,
       "numPlayers": 1,
       "spriteSize": 8,
@@ -272,7 +272,7 @@ We have some useful sprites in the
 Let's import it (don't forget to add the dependency):
 
 ```python
-from meltingpot.python.utils.substrates import shapes
+from meltingpot.utils.substrates import shapes
 ```
 
 and change our avatar's Appearance `Component` to:
@@ -501,7 +501,7 @@ character in the ASCII map, and call the prefab `"apple"`.
   config.lab2d_settings = {
       "levelName": "harvest",
       "levelDirectory":
-          "meltingpot/tutorial/harvest/levels",
+          "meltingpot/examples/tutorial/harvest/levels",
       "maxEpisodeLengthFrames": 100,
       "numPlayers": 5,
       "spriteSize": 8,
@@ -720,7 +720,7 @@ First set `config.num_players = 5`. The rest of the changes go in
   config.lab2d_settings = {
       "levelName": "harvest_finished",
       "levelDirectory":
-          "meltingpot/tutorial/harvest/levels",
+          "meltingpot/examples/tutorial/harvest/levels",
       "maxEpisodeLengthFrames": 1000,
       "numPlayers": 5,
       "spriteSize": 8,
diff --git a/examples/pettingzoo/sb3_train.py b/examples/pettingzoo/sb3_train.py
index 8f5d56e7..7db999c7 100644
--- a/examples/pettingzoo/sb3_train.py
+++ b/examples/pettingzoo/sb3_train.py
@@ -14,6 +14,7 @@
 """Binary to run Stable Baselines 3 agents on meltingpot substrates."""
 
 import gym
+from meltingpot import substrate
 import stable_baselines3
 from stable_baselines3.common import callbacks
 from stable_baselines3.common import torch_layers
@@ -23,8 +24,7 @@
 from torch import nn
 import torch.nn.functional as F
 
-from examples.pettingzoo import utils
-from meltingpot.python import substrate
+from . import utils
 
 device = torch.device("cuda") if torch.cuda.is_available() else torch.device(
     "cpu")
diff --git a/examples/pettingzoo/utils.py b/examples/pettingzoo/utils.py
index 6a2daba5..f5b40482 100644
--- a/examples/pettingzoo/utils.py
+++ b/examples/pettingzoo/utils.py
@@ -17,12 +17,12 @@
 
 from gym import utils as gym_utils
 import matplotlib.pyplot as plt
+from meltingpot import substrate
 from ml_collections import config_dict
 from pettingzoo import utils as pettingzoo_utils
 from pettingzoo.utils import wrappers
 
-from examples import utils
-from meltingpot.python import substrate
+from .. import utils
 
 PLAYER_STR_FORMAT = 'player_{index}'
 MAX_CYCLES = 1000
diff --git a/examples/rllib/self_play_train.py b/examples/rllib/self_play_train.py
index 871e3d2d..ee027fe1 100644
--- a/examples/rllib/self_play_train.py
+++ b/examples/rllib/self_play_train.py
@@ -15,14 +15,14 @@
 
 import os
 
+from meltingpot import substrate
 import ray
 from ray import air
 from ray import tune
 from ray.rllib.algorithms import ppo
 from ray.rllib.policy.policy import PolicySpec
 
-from examples.rllib import utils
-from meltingpot.python import substrate
+from . import utils
 
 
 def get_config(
diff --git a/examples/rllib/tests/test_environment.py b/examples/rllib/tests/test_environment.py
index d8701bb9..5236ad3c 100644
--- a/examples/rllib/tests/test_environment.py
+++ b/examples/rllib/tests/test_environment.py
@@ -15,10 +15,10 @@
 
 from absl.testing import absltest
 from gym.spaces import discrete
+from meltingpot import substrate
+from meltingpot.configs.substrates import commons_harvest_open
 
-from examples.rllib import utils
-from meltingpot.python import substrate
-from meltingpot.python.configs.substrates import commons_harvest_open
+from .. import utils
 
 
 class MeltingPotEnvTests(absltest.TestCase):
diff --git a/examples/rllib/utils.py b/examples/rllib/utils.py
index d1b72edc..7eebc078 100644
--- a/examples/rllib/utils.py
+++ b/examples/rllib/utils.py
@@ -18,15 +18,16 @@
 import dm_env
 import dmlab2d
 from gym import spaces
+from meltingpot import substrate
+from meltingpot.utils.policies import policy
 from ml_collections import config_dict
 import numpy as np
 from ray.rllib import algorithms
 from ray.rllib.env import multi_agent_env
 from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
 
-from examples import utils
-from meltingpot.python import substrate
-from meltingpot.python.utils.policies import policy
+from .. import utils
+
 
 PLAYER_STR_FORMAT = 'player_{index}'
 
diff --git a/examples/rllib/view_models.py b/examples/rllib/view_models.py
index 08e7b62c..c9b23c14 100644
--- a/examples/rllib/view_models.py
+++ b/examples/rllib/view_models.py
@@ -26,7 +26,7 @@
 from ray.tune.analysis.experiment_analysis import ExperimentAnalysis
 from ray.tune.registry import register_env
 
-from examples.rllib import utils
+from . import utils
 
 
 def main():
diff --git a/examples/tutorial/harvest/configs/environment/harvest_finished.py b/examples/tutorial/harvest/configs/environment/harvest_finished.py
index c300d409..4b27510d 100644
--- a/examples/tutorial/harvest/configs/environment/harvest_finished.py
+++ b/examples/tutorial/harvest/configs/environment/harvest_finished.py
@@ -14,7 +14,7 @@
 """Configuration for finished tutorial level: Harvest."""
 
 from ml_collections import config_dict
-from meltingpot.python.utils.substrates import shapes
+from meltingpot.utils.substrates import shapes
 
 
 SPAWN_POINT = {
diff --git a/examples/tutorial/harvest/play_harvest.py b/examples/tutorial/harvest/play_harvest.py
index 1b235d3a..e2b2684f 100644
--- a/examples/tutorial/harvest/play_harvest.py
+++ b/examples/tutorial/harvest/play_harvest.py
@@ -18,8 +18,8 @@
 from absl import app
 from absl import flags
 
-from examples.tutorial.harvest.configs.environment import harvest as game
-from meltingpot.python.human_players import level_playing_utils
+from .configs.environment import harvest as game
+from meltingpot.human_players import level_playing_utils
 
 FLAGS = flags.FLAGS
 
diff --git a/meltingpot/python/__init__.py b/meltingpot/python/__init__.py
index 4c34df60..af556c4d 100644
--- a/meltingpot/python/__init__.py
+++ b/meltingpot/python/__init__.py
@@ -13,6 +13,6 @@
 # limitations under the License.
 """Melting Pot."""
 
-from meltingpot.python import bot
-from meltingpot.python import scenario
-from meltingpot.python import substrate
+from meltingpot import bot
+from meltingpot import scenario
+from meltingpot import substrate
diff --git a/meltingpot/python/bot.py b/meltingpot/python/bot.py
index 5df7f585..93d77f5a 100644
--- a/meltingpot/python/bot.py
+++ b/meltingpot/python/bot.py
@@ -15,14 +15,14 @@
 
 import functools
 
-from meltingpot.python import substrate
-from meltingpot.python.configs import bots as bot_configs
-from meltingpot.python.utils.policies import fixed_action_policy
-from meltingpot.python.utils.policies import policy
-from meltingpot.python.utils.policies import policy_factory
-from meltingpot.python.utils.policies import puppet_policy
-from meltingpot.python.utils.policies import saved_model_policy
-from meltingpot.python.utils.substrates import specs
+from meltingpot import substrate
+from meltingpot.configs import bots as bot_configs
+from meltingpot.utils.policies import fixed_action_policy
+from meltingpot.utils.policies import policy
+from meltingpot.utils.policies import policy_factory
+from meltingpot.utils.policies import puppet_policy
+from meltingpot.utils.policies import saved_model_policy
+from meltingpot.utils.substrates import specs
 
 NOOP_BOT_NAME = 'noop_bot'
 NOOP_ACTION = 0
diff --git a/meltingpot/python/bot_test.py b/meltingpot/python/bot_test.py
index bf22d8bc..32959310 100644
--- a/meltingpot/python/bot_test.py
+++ b/meltingpot/python/bot_test.py
@@ -16,8 +16,8 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python import bot
-from meltingpot.python.testing import bots as test_utils
+from meltingpot import bot
+from meltingpot.testing import bots as test_utils
 
 
 @parameterized.named_parameters((name, name) for name in bot.BOTS)
diff --git a/meltingpot/python/configs/bots/__init__.py b/meltingpot/python/configs/bots/__init__.py
index 8f1f287a..34c1c543 100644
--- a/meltingpot/python/configs/bots/__init__.py
+++ b/meltingpot/python/configs/bots/__init__.py
@@ -20,21 +20,20 @@
 
 import immutabledict
 
-from meltingpot.python.utils.puppeteers import alternator
-from meltingpot.python.utils.puppeteers import clean_up
-from meltingpot.python.utils.puppeteers import coins
-from meltingpot.python.utils.puppeteers import coordination_in_the_matrix
-from meltingpot.python.utils.puppeteers import fixed_goal
-from meltingpot.python.utils.puppeteers import gift_refinements
-from meltingpot.python.utils.puppeteers import in_the_matrix
-from meltingpot.python.utils.puppeteers import puppeteer
-from meltingpot.python.utils.puppeteers import running_with_scissors_in_the_matrix
+from meltingpot.utils.puppeteers import alternator
+from meltingpot.utils.puppeteers import clean_up
+from meltingpot.utils.puppeteers import coins
+from meltingpot.utils.puppeteers import coordination_in_the_matrix
+from meltingpot.utils.puppeteers import fixed_goal
+from meltingpot.utils.puppeteers import gift_refinements
+from meltingpot.utils.puppeteers import in_the_matrix
+from meltingpot.utils.puppeteers import puppeteer
+from meltingpot.utils.puppeteers import running_with_scissors_in_the_matrix
 
 
 def _find_models_root() -> str:
   import re  # pylint: disable=g-import-not-at-top
-  return re.sub('meltingpot/python/.*', 'meltingpot/assets/saved_models',
-                __file__)
+  return re.sub('meltingpot/.*?$', 'meltingpot/assets/saved_models/', __file__)
 
 
 MODELS_ROOT = _find_models_root()
diff --git a/meltingpot/python/configs/bots/bot_configs_test.py b/meltingpot/python/configs/bots/bot_configs_test.py
index 27a8696f..c8efd436 100644
--- a/meltingpot/python/configs/bots/bot_configs_test.py
+++ b/meltingpot/python/configs/bots/bot_configs_test.py
@@ -19,8 +19,8 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.configs import bots
-from meltingpot.python.configs import substrates
+from meltingpot.configs import bots
+from meltingpot.configs import substrates
 
 
 def _subdirs(root):
diff --git a/meltingpot/python/configs/scenarios/scenario_configs_test.py b/meltingpot/python/configs/scenarios/scenario_configs_test.py
index b6c9e842..75aabf30 100644
--- a/meltingpot/python/configs/scenarios/scenario_configs_test.py
+++ b/meltingpot/python/configs/scenarios/scenario_configs_test.py
@@ -18,10 +18,10 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python import bot as bot_factory
-from meltingpot.python.configs import bots
-from meltingpot.python.configs import scenarios
-from meltingpot.python.configs import substrates
+from meltingpot import bot as bot_factory
+from meltingpot.configs import bots
+from meltingpot.configs import scenarios
+from meltingpot.configs import substrates
 
 SCENARIO_CONFIGS = scenarios.SCENARIO_CONFIGS
 AVAILABLE_BOTS = bot_factory.BOTS
diff --git a/meltingpot/python/configs/substrates/allelopathic_harvest.py b/meltingpot/python/configs/substrates/allelopathic_harvest.py
index 6afbabbf..5e49d911 100644
--- a/meltingpot/python/configs/substrates/allelopathic_harvest.py
+++ b/meltingpot/python/configs/substrates/allelopathic_harvest.py
@@ -37,10 +37,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/allelopathic_harvest__open.py b/meltingpot/python/configs/substrates/allelopathic_harvest__open.py
index cacefbf0..10dbc564 100644
--- a/meltingpot/python/configs/substrates/allelopathic_harvest__open.py
+++ b/meltingpot/python/configs/substrates/allelopathic_harvest__open.py
@@ -35,7 +35,7 @@
 preferences. arXiv preprint arXiv:2010.09054.
 """
 
-from meltingpot.python.configs.substrates import allelopathic_harvest as base_config
+from meltingpot.configs.substrates import allelopathic_harvest as base_config
 
 OPEN_ASCII_MAP = """
 333PPPP12PPP322P32PPP1P13P3P3
diff --git a/meltingpot/python/configs/substrates/bach_or_stravinsky_in_the_matrix__arena.py b/meltingpot/python/configs/substrates/bach_or_stravinsky_in_the_matrix__arena.py
index 58dae5ae..4d5cafc3 100644
--- a/meltingpot/python/configs/substrates/bach_or_stravinsky_in_the_matrix__arena.py
+++ b/meltingpot/python/configs/substrates/bach_or_stravinsky_in_the_matrix__arena.py
@@ -33,11 +33,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/bach_or_stravinsky_in_the_matrix__repeated.py b/meltingpot/python/configs/substrates/bach_or_stravinsky_in_the_matrix__repeated.py
index b4c768d0..5fb45d01 100644
--- a/meltingpot/python/configs/substrates/bach_or_stravinsky_in_the_matrix__repeated.py
+++ b/meltingpot/python/configs/substrates/bach_or_stravinsky_in_the_matrix__repeated.py
@@ -36,11 +36,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/boat_race.py b/meltingpot/python/configs/substrates/boat_race.py
index a5584d1c..37aeea61 100644
--- a/meltingpot/python/configs/substrates/boat_race.py
+++ b/meltingpot/python/configs/substrates/boat_race.py
@@ -34,9 +34,9 @@
 
 from ml_collections import config_dict as configdict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/boat_race__eight_races.py b/meltingpot/python/configs/substrates/boat_race__eight_races.py
index 70c71c88..d4259be6 100644
--- a/meltingpot/python/configs/substrates/boat_race__eight_races.py
+++ b/meltingpot/python/configs/substrates/boat_race__eight_races.py
@@ -15,7 +15,7 @@
 
 from ml_collections import config_dict as configdict
 
-from meltingpot.python.configs.substrates import boat_race as base_config
+from meltingpot.configs.substrates import boat_race as base_config
 
 
 def get_config() -> configdict.ConfigDict:
diff --git a/meltingpot/python/configs/substrates/chemistry__three_metabolic_cycles.py b/meltingpot/python/configs/substrates/chemistry__three_metabolic_cycles.py
index 52339e35..36897097 100644
--- a/meltingpot/python/configs/substrates/chemistry__three_metabolic_cycles.py
+++ b/meltingpot/python/configs/substrates/chemistry__three_metabolic_cycles.py
@@ -36,10 +36,10 @@
 from ml_collections import config_dict
 import networkx as nx
 
-from meltingpot.python.configs.substrates import reaction_graph_utils as graph_utils
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import reaction_graph_utils as graph_utils
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/chemistry__three_metabolic_cycles_with_plentiful_distractors.py b/meltingpot/python/configs/substrates/chemistry__three_metabolic_cycles_with_plentiful_distractors.py
index 4a5ca42e..fe3b07a8 100644
--- a/meltingpot/python/configs/substrates/chemistry__three_metabolic_cycles_with_plentiful_distractors.py
+++ b/meltingpot/python/configs/substrates/chemistry__three_metabolic_cycles_with_plentiful_distractors.py
@@ -36,10 +36,10 @@
 from ml_collections import config_dict
 import networkx as nx
 
-from meltingpot.python.configs.substrates import reaction_graph_utils as graph_utils
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import reaction_graph_utils as graph_utils
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/chemistry__two_metabolic_cycles.py b/meltingpot/python/configs/substrates/chemistry__two_metabolic_cycles.py
index ad97231f..e1476a41 100644
--- a/meltingpot/python/configs/substrates/chemistry__two_metabolic_cycles.py
+++ b/meltingpot/python/configs/substrates/chemistry__two_metabolic_cycles.py
@@ -35,10 +35,10 @@
 from ml_collections import config_dict
 import networkx as nx
 
-from meltingpot.python.configs.substrates import reaction_graph_utils as graph_utils
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import reaction_graph_utils as graph_utils
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/chemistry__two_metabolic_cycles_with_distractors.py b/meltingpot/python/configs/substrates/chemistry__two_metabolic_cycles_with_distractors.py
index df8ff930..8687c35a 100644
--- a/meltingpot/python/configs/substrates/chemistry__two_metabolic_cycles_with_distractors.py
+++ b/meltingpot/python/configs/substrates/chemistry__two_metabolic_cycles_with_distractors.py
@@ -36,10 +36,10 @@
 from ml_collections import config_dict
 import networkx as nx
 
-from meltingpot.python.configs.substrates import reaction_graph_utils as graph_utils
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import reaction_graph_utils as graph_utils
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/chicken_in_the_matrix__arena.py b/meltingpot/python/configs/substrates/chicken_in_the_matrix__arena.py
index e358d7a9..135dc16d 100644
--- a/meltingpot/python/configs/substrates/chicken_in_the_matrix__arena.py
+++ b/meltingpot/python/configs/substrates/chicken_in_the_matrix__arena.py
@@ -26,11 +26,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/chicken_in_the_matrix__repeated.py b/meltingpot/python/configs/substrates/chicken_in_the_matrix__repeated.py
index ac4e317f..ebc3f401 100644
--- a/meltingpot/python/configs/substrates/chicken_in_the_matrix__repeated.py
+++ b/meltingpot/python/configs/substrates/chicken_in_the_matrix__repeated.py
@@ -29,10 +29,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/clean_up.py b/meltingpot/python/configs/substrates/clean_up.py
index f7aa79f5..921c0a5c 100644
--- a/meltingpot/python/configs/substrates/clean_up.py
+++ b/meltingpot/python/configs/substrates/clean_up.py
@@ -43,10 +43,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/coins.py b/meltingpot/python/configs/substrates/coins.py
index a5560d18..57e82d32 100644
--- a/meltingpot/python/configs/substrates/coins.py
+++ b/meltingpot/python/configs/substrates/coins.py
@@ -22,10 +22,10 @@
 
 from ml_collections import config_dict as configdict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/collaborative_cooking.py b/meltingpot/python/configs/substrates/collaborative_cooking.py
index 7aae039a..3390f0d7 100644
--- a/meltingpot/python/configs/substrates/collaborative_cooking.py
+++ b/meltingpot/python/configs/substrates/collaborative_cooking.py
@@ -29,10 +29,10 @@
 
 from ml_collections import config_dict as configdict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/collaborative_cooking__asymmetric.py b/meltingpot/python/configs/substrates/collaborative_cooking__asymmetric.py
index 90b7621c..6accef3d 100644
--- a/meltingpot/python/configs/substrates/collaborative_cooking__asymmetric.py
+++ b/meltingpot/python/configs/substrates/collaborative_cooking__asymmetric.py
@@ -35,8 +35,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import collaborative_cooking as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import collaborative_cooking as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/collaborative_cooking__circuit.py b/meltingpot/python/configs/substrates/collaborative_cooking__circuit.py
index 9334cede..dc4d0347 100644
--- a/meltingpot/python/configs/substrates/collaborative_cooking__circuit.py
+++ b/meltingpot/python/configs/substrates/collaborative_cooking__circuit.py
@@ -35,8 +35,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import collaborative_cooking as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import collaborative_cooking as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/collaborative_cooking__cramped.py b/meltingpot/python/configs/substrates/collaborative_cooking__cramped.py
index a93acfd4..690624c8 100644
--- a/meltingpot/python/configs/substrates/collaborative_cooking__cramped.py
+++ b/meltingpot/python/configs/substrates/collaborative_cooking__cramped.py
@@ -32,8 +32,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import collaborative_cooking as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import collaborative_cooking as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/collaborative_cooking__crowded.py b/meltingpot/python/configs/substrates/collaborative_cooking__crowded.py
index a3c09a98..ff4fb1be 100644
--- a/meltingpot/python/configs/substrates/collaborative_cooking__crowded.py
+++ b/meltingpot/python/configs/substrates/collaborative_cooking__crowded.py
@@ -35,8 +35,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import collaborative_cooking as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import collaborative_cooking as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/collaborative_cooking__figure_eight.py b/meltingpot/python/configs/substrates/collaborative_cooking__figure_eight.py
index 5a1f956a..6388d3c2 100644
--- a/meltingpot/python/configs/substrates/collaborative_cooking__figure_eight.py
+++ b/meltingpot/python/configs/substrates/collaborative_cooking__figure_eight.py
@@ -35,8 +35,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import collaborative_cooking as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import collaborative_cooking as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/collaborative_cooking__forced.py b/meltingpot/python/configs/substrates/collaborative_cooking__forced.py
index 83651b34..5586a5e2 100644
--- a/meltingpot/python/configs/substrates/collaborative_cooking__forced.py
+++ b/meltingpot/python/configs/substrates/collaborative_cooking__forced.py
@@ -35,8 +35,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import collaborative_cooking as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import collaborative_cooking as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/collaborative_cooking__ring.py b/meltingpot/python/configs/substrates/collaborative_cooking__ring.py
index c0ecf20a..e4303373 100644
--- a/meltingpot/python/configs/substrates/collaborative_cooking__ring.py
+++ b/meltingpot/python/configs/substrates/collaborative_cooking__ring.py
@@ -33,8 +33,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import collaborative_cooking as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import collaborative_cooking as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/commons_harvest__closed.py b/meltingpot/python/configs/substrates/commons_harvest__closed.py
index 83a24af8..8caa8c56 100644
--- a/meltingpot/python/configs/substrates/commons_harvest__closed.py
+++ b/meltingpot/python/configs/substrates/commons_harvest__closed.py
@@ -31,9 +31,9 @@
 from ml_collections import config_dict
 import numpy as np
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/commons_harvest__open.py b/meltingpot/python/configs/substrates/commons_harvest__open.py
index 273b9434..51906230 100644
--- a/meltingpot/python/configs/substrates/commons_harvest__open.py
+++ b/meltingpot/python/configs/substrates/commons_harvest__open.py
@@ -48,9 +48,9 @@
 from ml_collections import config_dict
 import numpy as np
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/commons_harvest__partnership.py b/meltingpot/python/configs/substrates/commons_harvest__partnership.py
index 4925dada..1170e235 100644
--- a/meltingpot/python/configs/substrates/commons_harvest__partnership.py
+++ b/meltingpot/python/configs/substrates/commons_harvest__partnership.py
@@ -34,9 +34,9 @@
 from ml_collections import config_dict
 import numpy as np
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/coop_mining.py b/meltingpot/python/configs/substrates/coop_mining.py
index 93af2c68..a69e8876 100644
--- a/meltingpot/python/configs/substrates/coop_mining.py
+++ b/meltingpot/python/configs/substrates/coop_mining.py
@@ -37,9 +37,9 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/daycare.py b/meltingpot/python/configs/substrates/daycare.py
index d6d92ff5..2732a81e 100644
--- a/meltingpot/python/configs/substrates/daycare.py
+++ b/meltingpot/python/configs/substrates/daycare.py
@@ -18,9 +18,9 @@
 
 from ml_collections import config_dict as configdict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/externality_mushrooms.py b/meltingpot/python/configs/substrates/externality_mushrooms.py
index 0573177d..bef65abf 100644
--- a/meltingpot/python/configs/substrates/externality_mushrooms.py
+++ b/meltingpot/python/configs/substrates/externality_mushrooms.py
@@ -50,10 +50,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/externality_mushrooms__dense.py b/meltingpot/python/configs/substrates/externality_mushrooms__dense.py
index 215576df..be445d05 100644
--- a/meltingpot/python/configs/substrates/externality_mushrooms__dense.py
+++ b/meltingpot/python/configs/substrates/externality_mushrooms__dense.py
@@ -23,8 +23,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import externality_mushrooms as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import externality_mushrooms as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/factory_commons.py b/meltingpot/python/configs/substrates/factory_commons.py
index 58890e4a..f1deecfb 100644
--- a/meltingpot/python/configs/substrates/factory_commons.py
+++ b/meltingpot/python/configs/substrates/factory_commons.py
@@ -17,9 +17,9 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/factory_commons__either_or.py b/meltingpot/python/configs/substrates/factory_commons__either_or.py
index f494d750..40306fcd 100644
--- a/meltingpot/python/configs/substrates/factory_commons__either_or.py
+++ b/meltingpot/python/configs/substrates/factory_commons__either_or.py
@@ -15,9 +15,9 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import factory_commons as base_config
-from meltingpot.python.utils.substrates import map_helpers
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import factory_commons as base_config
+from meltingpot.utils.substrates import map_helpers
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/fruit_market.py b/meltingpot/python/configs/substrates/fruit_market.py
index d5d44783..3826acc8 100644
--- a/meltingpot/python/configs/substrates/fruit_market.py
+++ b/meltingpot/python/configs/substrates/fruit_market.py
@@ -47,8 +47,8 @@
 
 from ml_collections import config_dict as configdict
 
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/fruit_market__concentric_rivers.py b/meltingpot/python/configs/substrates/fruit_market__concentric_rivers.py
index 49ef7b07..a8d55cfe 100644
--- a/meltingpot/python/configs/substrates/fruit_market__concentric_rivers.py
+++ b/meltingpot/python/configs/substrates/fruit_market__concentric_rivers.py
@@ -21,8 +21,8 @@
 
 from ml_collections import config_dict as configdict
 
-from meltingpot.python.configs.substrates import fruit_market as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import fruit_market as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/gift_refinements.py b/meltingpot/python/configs/substrates/gift_refinements.py
index 02e9bb96..a03405fd 100644
--- a/meltingpot/python/configs/substrates/gift_refinements.py
+++ b/meltingpot/python/configs/substrates/gift_refinements.py
@@ -57,9 +57,9 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/hidden_agenda.py b/meltingpot/python/configs/substrates/hidden_agenda.py
index c9b1d828..3fe26516 100644
--- a/meltingpot/python/configs/substrates/hidden_agenda.py
+++ b/meltingpot/python/configs/substrates/hidden_agenda.py
@@ -60,8 +60,8 @@
 from typing import Any, Mapping, Sequence
 
 from ml_collections import config_dict
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/paintball__capture_the_flag.py b/meltingpot/python/configs/substrates/paintball__capture_the_flag.py
index 3ed84f01..cab0b850 100644
--- a/meltingpot/python/configs/substrates/paintball__capture_the_flag.py
+++ b/meltingpot/python/configs/substrates/paintball__capture_the_flag.py
@@ -49,8 +49,8 @@
 from ml_collections import config_dict
 import numpy as np
 
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/paintball__king_of_the_hill.py b/meltingpot/python/configs/substrates/paintball__king_of_the_hill.py
index dd739022..b771d93d 100644
--- a/meltingpot/python/configs/substrates/paintball__king_of_the_hill.py
+++ b/meltingpot/python/configs/substrates/paintball__king_of_the_hill.py
@@ -31,8 +31,8 @@
 from ml_collections import config_dict
 import numpy as np
 
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/predator_prey.py b/meltingpot/python/configs/substrates/predator_prey.py
index e622661e..abc41498 100644
--- a/meltingpot/python/configs/substrates/predator_prey.py
+++ b/meltingpot/python/configs/substrates/predator_prey.py
@@ -55,9 +55,9 @@
 
 from ml_collections import config_dict as configdict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/predator_prey__alley_hunt.py b/meltingpot/python/configs/substrates/predator_prey__alley_hunt.py
index e81e7652..3df814aa 100644
--- a/meltingpot/python/configs/substrates/predator_prey__alley_hunt.py
+++ b/meltingpot/python/configs/substrates/predator_prey__alley_hunt.py
@@ -24,8 +24,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import predator_prey as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import predator_prey as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/predator_prey__open.py b/meltingpot/python/configs/substrates/predator_prey__open.py
index 077a446a..74e1163e 100644
--- a/meltingpot/python/configs/substrates/predator_prey__open.py
+++ b/meltingpot/python/configs/substrates/predator_prey__open.py
@@ -28,8 +28,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import predator_prey as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import predator_prey as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/predator_prey__orchard.py b/meltingpot/python/configs/substrates/predator_prey__orchard.py
index 9d3e4ba4..03dcdac4 100644
--- a/meltingpot/python/configs/substrates/predator_prey__orchard.py
+++ b/meltingpot/python/configs/substrates/predator_prey__orchard.py
@@ -28,8 +28,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import predator_prey as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import predator_prey as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/predator_prey__random_forest.py b/meltingpot/python/configs/substrates/predator_prey__random_forest.py
index 51c31d32..9c9a96b0 100644
--- a/meltingpot/python/configs/substrates/predator_prey__random_forest.py
+++ b/meltingpot/python/configs/substrates/predator_prey__random_forest.py
@@ -26,9 +26,9 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import predator_prey as base_config
-from meltingpot.python.utils.substrates import map_helpers
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import predator_prey as base_config
+from meltingpot.utils.substrates import map_helpers
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/prisoners_dilemma_in_the_matrix__arena.py b/meltingpot/python/configs/substrates/prisoners_dilemma_in_the_matrix__arena.py
index 3f2ea3ee..1f12178f 100644
--- a/meltingpot/python/configs/substrates/prisoners_dilemma_in_the_matrix__arena.py
+++ b/meltingpot/python/configs/substrates/prisoners_dilemma_in_the_matrix__arena.py
@@ -26,11 +26,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/prisoners_dilemma_in_the_matrix__repeated.py b/meltingpot/python/configs/substrates/prisoners_dilemma_in_the_matrix__repeated.py
index 7bc4e429..dcbcc631 100644
--- a/meltingpot/python/configs/substrates/prisoners_dilemma_in_the_matrix__repeated.py
+++ b/meltingpot/python/configs/substrates/prisoners_dilemma_in_the_matrix__repeated.py
@@ -29,10 +29,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/pure_coordination_in_the_matrix__arena.py b/meltingpot/python/configs/substrates/pure_coordination_in_the_matrix__arena.py
index f4cef1bd..ba21d678 100644
--- a/meltingpot/python/configs/substrates/pure_coordination_in_the_matrix__arena.py
+++ b/meltingpot/python/configs/substrates/pure_coordination_in_the_matrix__arena.py
@@ -28,11 +28,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/pure_coordination_in_the_matrix__repeated.py b/meltingpot/python/configs/substrates/pure_coordination_in_the_matrix__repeated.py
index fdcef8a7..8b46bc49 100644
--- a/meltingpot/python/configs/substrates/pure_coordination_in_the_matrix__repeated.py
+++ b/meltingpot/python/configs/substrates/pure_coordination_in_the_matrix__repeated.py
@@ -30,10 +30,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/rationalizable_coordination_in_the_matrix__arena.py b/meltingpot/python/configs/substrates/rationalizable_coordination_in_the_matrix__arena.py
index 0de0c68e..4f726108 100644
--- a/meltingpot/python/configs/substrates/rationalizable_coordination_in_the_matrix__arena.py
+++ b/meltingpot/python/configs/substrates/rationalizable_coordination_in_the_matrix__arena.py
@@ -30,11 +30,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/rationalizable_coordination_in_the_matrix__repeated.py b/meltingpot/python/configs/substrates/rationalizable_coordination_in_the_matrix__repeated.py
index 70341221..b547ff1c 100644
--- a/meltingpot/python/configs/substrates/rationalizable_coordination_in_the_matrix__repeated.py
+++ b/meltingpot/python/configs/substrates/rationalizable_coordination_in_the_matrix__repeated.py
@@ -30,10 +30,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/reaction_graph_utils.py b/meltingpot/python/configs/substrates/reaction_graph_utils.py
index 28044506..7d0c5f94 100644
--- a/meltingpot/python/configs/substrates/reaction_graph_utils.py
+++ b/meltingpot/python/configs/substrates/reaction_graph_utils.py
@@ -19,7 +19,7 @@
 import networkx as nx  # pylint: disable=unused-import
 import numpy as np
 
-from meltingpot.python.utils.substrates import shapes
+from meltingpot.utils.substrates import shapes
 
 EMPTY_COLOR = shapes.PETRI_DISH_PALETTE["@"]
 WHITE_COLOR = (255, 255, 255, 255)  # A white color.
diff --git a/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__arena.py b/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__arena.py
index 4bb2cb21..283c9be5 100644
--- a/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__arena.py
+++ b/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__arena.py
@@ -27,11 +27,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__one_shot.py b/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__one_shot.py
index 80f20516..6c5e3a2f 100644
--- a/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__one_shot.py
+++ b/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__one_shot.py
@@ -61,10 +61,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__repeated.py b/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__repeated.py
index 144f9c7c..0ac05adb 100644
--- a/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__repeated.py
+++ b/meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix__repeated.py
@@ -62,10 +62,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/stag_hunt_in_the_matrix__arena.py b/meltingpot/python/configs/substrates/stag_hunt_in_the_matrix__arena.py
index f72c1db0..7ca1e801 100644
--- a/meltingpot/python/configs/substrates/stag_hunt_in_the_matrix__arena.py
+++ b/meltingpot/python/configs/substrates/stag_hunt_in_the_matrix__arena.py
@@ -29,11 +29,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/stag_hunt_in_the_matrix__repeated.py b/meltingpot/python/configs/substrates/stag_hunt_in_the_matrix__repeated.py
index 1581be50..bb31461d 100644
--- a/meltingpot/python/configs/substrates/stag_hunt_in_the_matrix__repeated.py
+++ b/meltingpot/python/configs/substrates/stag_hunt_in_the_matrix__repeated.py
@@ -29,10 +29,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import the_matrix
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import the_matrix
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 # Warning: setting `_ENABLE_DEBUG_OBSERVATIONS = True` may cause slowdown.
 _ENABLE_DEBUG_OBSERVATIONS = False
diff --git a/meltingpot/python/configs/substrates/territory.py b/meltingpot/python/configs/substrates/territory.py
index 8148becb..28347063 100644
--- a/meltingpot/python/configs/substrates/territory.py
+++ b/meltingpot/python/configs/substrates/territory.py
@@ -21,10 +21,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates import shapes
-from meltingpot.python.utils.substrates import specs
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import shapes
+from meltingpot.utils.substrates import specs
 
 PrefabConfig = game_object_utils.PrefabConfig
 
diff --git a/meltingpot/python/configs/substrates/territory__inside_out.py b/meltingpot/python/configs/substrates/territory__inside_out.py
index 83504010..3b8f960f 100644
--- a/meltingpot/python/configs/substrates/territory__inside_out.py
+++ b/meltingpot/python/configs/substrates/territory__inside_out.py
@@ -31,9 +31,9 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import territory as base_config
-from meltingpot.python.utils.substrates import map_helpers
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import territory as base_config
+from meltingpot.utils.substrates import map_helpers
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/territory__open.py b/meltingpot/python/configs/substrates/territory__open.py
index d045b91f..e6500826 100644
--- a/meltingpot/python/configs/substrates/territory__open.py
+++ b/meltingpot/python/configs/substrates/territory__open.py
@@ -45,8 +45,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import territory as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import territory as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/territory__rooms.py b/meltingpot/python/configs/substrates/territory__rooms.py
index 75c8288b..35386a6d 100644
--- a/meltingpot/python/configs/substrates/territory__rooms.py
+++ b/meltingpot/python/configs/substrates/territory__rooms.py
@@ -33,8 +33,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import territory as base_config
-from meltingpot.python.utils.substrates import specs
+from meltingpot.configs.substrates import territory as base_config
+from meltingpot.utils.substrates import specs
 
 build = base_config.build
 
diff --git a/meltingpot/python/configs/substrates/the_matrix.py b/meltingpot/python/configs/substrates/the_matrix.py
index f6a7f889..3d24e092 100644
--- a/meltingpot/python/configs/substrates/the_matrix.py
+++ b/meltingpot/python/configs/substrates/the_matrix.py
@@ -16,7 +16,7 @@
 import copy
 from typing import Any, Dict, Mapping, Sequence
 
-from meltingpot.python.utils.substrates import shapes
+from meltingpot.utils.substrates import shapes
 
 
 def get_cumulant_metric_configs(
diff --git a/meltingpot/python/human_players/level_playing_utils.py b/meltingpot/python/human_players/level_playing_utils.py
index 2ea04264..4f66122e 100644
--- a/meltingpot/python/human_players/level_playing_utils.py
+++ b/meltingpot/python/human_players/level_playing_utils.py
@@ -30,7 +30,7 @@
 import pygame
 
 import dmlab2d
-from meltingpot.python.utils.substrates import builder
+from meltingpot.utils.substrates import builder
 
 WHITE = (255, 255, 255)
 
diff --git a/meltingpot/python/human_players/play_allelopathic_harvest.py b/meltingpot/python/human_players/play_allelopathic_harvest.py
index f3d7b89c..3e55052d 100644
--- a/meltingpot/python/human_players/play_allelopathic_harvest.py
+++ b/meltingpot/python/human_players/play_allelopathic_harvest.py
@@ -23,8 +23,8 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import allelopathic_harvest__open
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import allelopathic_harvest__open
+from meltingpot.human_players import level_playing_utils
 
 
 environment_configs = {
diff --git a/meltingpot/python/human_players/play_anything_in_the_matrix.py b/meltingpot/python/human_players/play_anything_in_the_matrix.py
index 85e91f32..26cc7cf5 100644
--- a/meltingpot/python/human_players/play_anything_in_the_matrix.py
+++ b/meltingpot/python/human_players/play_anything_in_the_matrix.py
@@ -23,22 +23,22 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import bach_or_stravinsky_in_the_matrix__arena as bach_or_stravinsky_itm
-from meltingpot.python.configs.substrates import bach_or_stravinsky_in_the_matrix__repeated as bach_or_stravinsky_itm__repeated
-from meltingpot.python.configs.substrates import chicken_in_the_matrix__arena as chicken_itm
-from meltingpot.python.configs.substrates import chicken_in_the_matrix__repeated as chicken_itm__repeated
-from meltingpot.python.configs.substrates import prisoners_dilemma_in_the_matrix__arena as prisoners_dilemma_itm
-from meltingpot.python.configs.substrates import prisoners_dilemma_in_the_matrix__repeated as prisoners_dilemma_itm__repeated
-from meltingpot.python.configs.substrates import pure_coordination_in_the_matrix__arena as pure_coord_itm
-from meltingpot.python.configs.substrates import pure_coordination_in_the_matrix__repeated as pure_coord_itm__repeated
-from meltingpot.python.configs.substrates import rationalizable_coordination_in_the_matrix__arena as rational_coord_itm
-from meltingpot.python.configs.substrates import rationalizable_coordination_in_the_matrix__repeated as rational_coord_itm__repeated
-from meltingpot.python.configs.substrates import running_with_scissors_in_the_matrix__arena as rws_itm__arena
-from meltingpot.python.configs.substrates import running_with_scissors_in_the_matrix__one_shot as rws_itm
-from meltingpot.python.configs.substrates import running_with_scissors_in_the_matrix__repeated as rws_itm__repeated
-from meltingpot.python.configs.substrates import stag_hunt_in_the_matrix__arena as stag_hunt_itm
-from meltingpot.python.configs.substrates import stag_hunt_in_the_matrix__repeated as stag_hunt_itm__repeated
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import bach_or_stravinsky_in_the_matrix__arena as bach_or_stravinsky_itm
+from meltingpot.configs.substrates import bach_or_stravinsky_in_the_matrix__repeated as bach_or_stravinsky_itm__repeated
+from meltingpot.configs.substrates import chicken_in_the_matrix__arena as chicken_itm
+from meltingpot.configs.substrates import chicken_in_the_matrix__repeated as chicken_itm__repeated
+from meltingpot.configs.substrates import prisoners_dilemma_in_the_matrix__arena as prisoners_dilemma_itm
+from meltingpot.configs.substrates import prisoners_dilemma_in_the_matrix__repeated as prisoners_dilemma_itm__repeated
+from meltingpot.configs.substrates import pure_coordination_in_the_matrix__arena as pure_coord_itm
+from meltingpot.configs.substrates import pure_coordination_in_the_matrix__repeated as pure_coord_itm__repeated
+from meltingpot.configs.substrates import rationalizable_coordination_in_the_matrix__arena as rational_coord_itm
+from meltingpot.configs.substrates import rationalizable_coordination_in_the_matrix__repeated as rational_coord_itm__repeated
+from meltingpot.configs.substrates import running_with_scissors_in_the_matrix__arena as rws_itm__arena
+from meltingpot.configs.substrates import running_with_scissors_in_the_matrix__one_shot as rws_itm
+from meltingpot.configs.substrates import running_with_scissors_in_the_matrix__repeated as rws_itm__repeated
+from meltingpot.configs.substrates import stag_hunt_in_the_matrix__arena as stag_hunt_itm
+from meltingpot.configs.substrates import stag_hunt_in_the_matrix__repeated as stag_hunt_itm__repeated
+from meltingpot.human_players import level_playing_utils
 
 environment_configs = {
     'bach_or_stravinsky_in_the_matrix__arena': bach_or_stravinsky_itm,
diff --git a/meltingpot/python/human_players/play_boat_race.py b/meltingpot/python/human_players/play_boat_race.py
index 18f1a205..da357ef9 100644
--- a/meltingpot/python/human_players/play_boat_race.py
+++ b/meltingpot/python/human_players/play_boat_race.py
@@ -24,9 +24,9 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import boat_race__eight_races
-from meltingpot.python.human_players import level_playing_utils
-from meltingpot.python.utils.substrates import game_object_utils
+from meltingpot.configs.substrates import boat_race__eight_races
+from meltingpot.human_players import level_playing_utils
+from meltingpot.utils.substrates import game_object_utils
 
 MAX_SCREEN_WIDTH = 600
 MAX_SCREEN_HEIGHT = 800
diff --git a/meltingpot/python/human_players/play_chemistry.py b/meltingpot/python/human_players/play_chemistry.py
index 8a87f813..4c04b1c0 100644
--- a/meltingpot/python/human_players/play_chemistry.py
+++ b/meltingpot/python/human_players/play_chemistry.py
@@ -23,11 +23,11 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import chemistry__three_metabolic_cycles
-from meltingpot.python.configs.substrates import chemistry__three_metabolic_cycles_with_plentiful_distractors
-from meltingpot.python.configs.substrates import chemistry__two_metabolic_cycles
-from meltingpot.python.configs.substrates import chemistry__two_metabolic_cycles_with_distractors
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import chemistry__three_metabolic_cycles
+from meltingpot.configs.substrates import chemistry__three_metabolic_cycles_with_plentiful_distractors
+from meltingpot.configs.substrates import chemistry__two_metabolic_cycles
+from meltingpot.configs.substrates import chemistry__two_metabolic_cycles_with_distractors
+from meltingpot.human_players import level_playing_utils
 
 
 MAX_SCREEN_WIDTH = 800
diff --git a/meltingpot/python/human_players/play_clean_up.py b/meltingpot/python/human_players/play_clean_up.py
index 75bb551a..1bd0a593 100644
--- a/meltingpot/python/human_players/play_clean_up.py
+++ b/meltingpot/python/human_players/play_clean_up.py
@@ -23,8 +23,8 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import clean_up
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import clean_up
+from meltingpot.human_players import level_playing_utils
 
 
 environment_configs = {
diff --git a/meltingpot/python/human_players/play_coins.py b/meltingpot/python/human_players/play_coins.py
index 75cdcd66..042bb902 100644
--- a/meltingpot/python/human_players/play_coins.py
+++ b/meltingpot/python/human_players/play_coins.py
@@ -21,8 +21,8 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import coins
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import coins
+from meltingpot.human_players import level_playing_utils
 
 MAX_SCREEN_WIDTH = 600
 MAX_SCREEN_HEIGHT = 450
diff --git a/meltingpot/python/human_players/play_collaborative_cooking.py b/meltingpot/python/human_players/play_collaborative_cooking.py
index 27e8974e..2d39e8d2 100644
--- a/meltingpot/python/human_players/play_collaborative_cooking.py
+++ b/meltingpot/python/human_players/play_collaborative_cooking.py
@@ -24,14 +24,14 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import collaborative_cooking__asymmetric
-from meltingpot.python.configs.substrates import collaborative_cooking__circuit
-from meltingpot.python.configs.substrates import collaborative_cooking__cramped
-from meltingpot.python.configs.substrates import collaborative_cooking__crowded
-from meltingpot.python.configs.substrates import collaborative_cooking__figure_eight
-from meltingpot.python.configs.substrates import collaborative_cooking__forced
-from meltingpot.python.configs.substrates import collaborative_cooking__ring
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import collaborative_cooking__asymmetric
+from meltingpot.configs.substrates import collaborative_cooking__circuit
+from meltingpot.configs.substrates import collaborative_cooking__cramped
+from meltingpot.configs.substrates import collaborative_cooking__crowded
+from meltingpot.configs.substrates import collaborative_cooking__figure_eight
+from meltingpot.configs.substrates import collaborative_cooking__forced
+from meltingpot.configs.substrates import collaborative_cooking__ring
+from meltingpot.human_players import level_playing_utils
 
 
 MAX_SCREEN_WIDTH = 800
diff --git a/meltingpot/python/human_players/play_commons_harvest.py b/meltingpot/python/human_players/play_commons_harvest.py
index 137f395a..22546ea6 100644
--- a/meltingpot/python/human_players/play_commons_harvest.py
+++ b/meltingpot/python/human_players/play_commons_harvest.py
@@ -23,10 +23,10 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import commons_harvest__closed
-from meltingpot.python.configs.substrates import commons_harvest__open
-from meltingpot.python.configs.substrates import commons_harvest__partnership
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import commons_harvest__closed
+from meltingpot.configs.substrates import commons_harvest__open
+from meltingpot.configs.substrates import commons_harvest__partnership
+from meltingpot.human_players import level_playing_utils
 
 
 environment_configs = {
diff --git a/meltingpot/python/human_players/play_coop_mining.py b/meltingpot/python/human_players/play_coop_mining.py
index 289a699a..4628759d 100644
--- a/meltingpot/python/human_players/play_coop_mining.py
+++ b/meltingpot/python/human_players/play_coop_mining.py
@@ -24,8 +24,8 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import coop_mining
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import coop_mining
+from meltingpot.human_players import level_playing_utils
 
 
 environment_configs = {
diff --git a/meltingpot/python/human_players/play_daycare.py b/meltingpot/python/human_players/play_daycare.py
index 08824e4c..3b1b1473 100644
--- a/meltingpot/python/human_players/play_daycare.py
+++ b/meltingpot/python/human_players/play_daycare.py
@@ -22,8 +22,8 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import daycare
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import daycare
+from meltingpot.human_players import level_playing_utils
 
 
 MAX_SCREEN_WIDTH = 800
diff --git a/meltingpot/python/human_players/play_externality_mushrooms.py b/meltingpot/python/human_players/play_externality_mushrooms.py
index 1a1ee0ca..faf1e864 100644
--- a/meltingpot/python/human_players/play_externality_mushrooms.py
+++ b/meltingpot/python/human_players/play_externality_mushrooms.py
@@ -24,8 +24,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import externality_mushrooms__dense
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import externality_mushrooms__dense
+from meltingpot.human_players import level_playing_utils
 
 
 environment_configs = {
diff --git a/meltingpot/python/human_players/play_factory_commons.py b/meltingpot/python/human_players/play_factory_commons.py
index 4e5303ff..ee87f7c1 100644
--- a/meltingpot/python/human_players/play_factory_commons.py
+++ b/meltingpot/python/human_players/play_factory_commons.py
@@ -24,8 +24,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import factory_commons__either_or
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import factory_commons__either_or
+from meltingpot.human_players import level_playing_utils
 
 
 def get_push_pull() -> int:
diff --git a/meltingpot/python/human_players/play_fruit_market.py b/meltingpot/python/human_players/play_fruit_market.py
index e824bb09..4b772c6c 100644
--- a/meltingpot/python/human_players/play_fruit_market.py
+++ b/meltingpot/python/human_players/play_fruit_market.py
@@ -29,8 +29,8 @@
 from ml_collections import config_dict
 import pygame
 
-from meltingpot.python.configs.substrates import fruit_market__concentric_rivers
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import fruit_market__concentric_rivers
+from meltingpot.human_players import level_playing_utils
 
 
 def get_offer_apple_pressed() -> int:
diff --git a/meltingpot/python/human_players/play_gift_refinements.py b/meltingpot/python/human_players/play_gift_refinements.py
index 6089d6cb..71da980c 100644
--- a/meltingpot/python/human_players/play_gift_refinements.py
+++ b/meltingpot/python/human_players/play_gift_refinements.py
@@ -24,8 +24,8 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import gift_refinements
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import gift_refinements
+from meltingpot.human_players import level_playing_utils
 
 
 environment_configs = {
diff --git a/meltingpot/python/human_players/play_hidden_agenda.py b/meltingpot/python/human_players/play_hidden_agenda.py
index fe39b753..b1a32978 100644
--- a/meltingpot/python/human_players/play_hidden_agenda.py
+++ b/meltingpot/python/human_players/play_hidden_agenda.py
@@ -24,8 +24,8 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import hidden_agenda
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import hidden_agenda
+from meltingpot.human_players import level_playing_utils
 
 
 MAX_SCREEN_WIDTH = 800
diff --git a/meltingpot/python/human_players/play_level_test.py b/meltingpot/python/human_players/play_level_test.py
index 3b3dd04f..3dce48b4 100644
--- a/meltingpot/python/human_players/play_level_test.py
+++ b/meltingpot/python/human_players/play_level_test.py
@@ -20,46 +20,46 @@
 from ml_collections import config_dict
 import pygame
 
-from meltingpot.python.configs.substrates import allelopathic_harvest__open
-from meltingpot.python.configs.substrates import boat_race__eight_races
-from meltingpot.python.configs.substrates import chemistry__three_metabolic_cycles
-from meltingpot.python.configs.substrates import chemistry__three_metabolic_cycles_with_plentiful_distractors
-from meltingpot.python.configs.substrates import chemistry__two_metabolic_cycles
-from meltingpot.python.configs.substrates import chemistry__two_metabolic_cycles_with_distractors
-from meltingpot.python.configs.substrates import clean_up
-from meltingpot.python.configs.substrates import coins
-from meltingpot.python.configs.substrates import collaborative_cooking__asymmetric
-from meltingpot.python.configs.substrates import commons_harvest__closed
-from meltingpot.python.configs.substrates import coop_mining
-from meltingpot.python.configs.substrates import daycare
-from meltingpot.python.configs.substrates import externality_mushrooms__dense
-from meltingpot.python.configs.substrates import factory_commons__either_or
-from meltingpot.python.configs.substrates import fruit_market__concentric_rivers
-from meltingpot.python.configs.substrates import gift_refinements
-from meltingpot.python.configs.substrates import paintball__capture_the_flag
-from meltingpot.python.configs.substrates import paintball__king_of_the_hill
-from meltingpot.python.configs.substrates import predator_prey__alley_hunt
-from meltingpot.python.configs.substrates import predator_prey__orchard
-from meltingpot.python.configs.substrates import prisoners_dilemma_in_the_matrix__arena
-from meltingpot.python.configs.substrates import territory__rooms
-from meltingpot.python.human_players import level_playing_utils
-from meltingpot.python.human_players import play_allelopathic_harvest
-from meltingpot.python.human_players import play_anything_in_the_matrix
-from meltingpot.python.human_players import play_boat_race
-from meltingpot.python.human_players import play_chemistry
-from meltingpot.python.human_players import play_clean_up
-from meltingpot.python.human_players import play_coins
-from meltingpot.python.human_players import play_collaborative_cooking
-from meltingpot.python.human_players import play_commons_harvest
-from meltingpot.python.human_players import play_coop_mining
-from meltingpot.python.human_players import play_daycare
-from meltingpot.python.human_players import play_externality_mushrooms
-from meltingpot.python.human_players import play_factory_commons
-from meltingpot.python.human_players import play_fruit_market
-from meltingpot.python.human_players import play_gift_refinements
-from meltingpot.python.human_players import play_paintball
-from meltingpot.python.human_players import play_predator_and_prey
-from meltingpot.python.human_players import play_territory
+from meltingpot.configs.substrates import allelopathic_harvest__open
+from meltingpot.configs.substrates import boat_race__eight_races
+from meltingpot.configs.substrates import chemistry__three_metabolic_cycles
+from meltingpot.configs.substrates import chemistry__three_metabolic_cycles_with_plentiful_distractors
+from meltingpot.configs.substrates import chemistry__two_metabolic_cycles
+from meltingpot.configs.substrates import chemistry__two_metabolic_cycles_with_distractors
+from meltingpot.configs.substrates import clean_up
+from meltingpot.configs.substrates import coins
+from meltingpot.configs.substrates import collaborative_cooking__asymmetric
+from meltingpot.configs.substrates import commons_harvest__closed
+from meltingpot.configs.substrates import coop_mining
+from meltingpot.configs.substrates import daycare
+from meltingpot.configs.substrates import externality_mushrooms__dense
+from meltingpot.configs.substrates import factory_commons__either_or
+from meltingpot.configs.substrates import fruit_market__concentric_rivers
+from meltingpot.configs.substrates import gift_refinements
+from meltingpot.configs.substrates import paintball__capture_the_flag
+from meltingpot.configs.substrates import paintball__king_of_the_hill
+from meltingpot.configs.substrates import predator_prey__alley_hunt
+from meltingpot.configs.substrates import predator_prey__orchard
+from meltingpot.configs.substrates import prisoners_dilemma_in_the_matrix__arena
+from meltingpot.configs.substrates import territory__rooms
+from meltingpot.human_players import level_playing_utils
+from meltingpot.human_players import play_allelopathic_harvest
+from meltingpot.human_players import play_anything_in_the_matrix
+from meltingpot.human_players import play_boat_race
+from meltingpot.human_players import play_chemistry
+from meltingpot.human_players import play_clean_up
+from meltingpot.human_players import play_coins
+from meltingpot.human_players import play_collaborative_cooking
+from meltingpot.human_players import play_commons_harvest
+from meltingpot.human_players import play_coop_mining
+from meltingpot.human_players import play_daycare
+from meltingpot.human_players import play_externality_mushrooms
+from meltingpot.human_players import play_factory_commons
+from meltingpot.human_players import play_fruit_market
+from meltingpot.human_players import play_gift_refinements
+from meltingpot.human_players import play_paintball
+from meltingpot.human_players import play_predator_and_prey
+from meltingpot.human_players import play_territory
 
 
 class PlayLevelTest(parameterized.TestCase):
diff --git a/meltingpot/python/human_players/play_paintball.py b/meltingpot/python/human_players/play_paintball.py
index 0aaa143f..543aea26 100644
--- a/meltingpot/python/human_players/play_paintball.py
+++ b/meltingpot/python/human_players/play_paintball.py
@@ -23,9 +23,9 @@
 import json
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import paintball__capture_the_flag
-from meltingpot.python.configs.substrates import paintball__king_of_the_hill
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import paintball__capture_the_flag
+from meltingpot.configs.substrates import paintball__king_of_the_hill
+from meltingpot.human_players import level_playing_utils
 
 
 def get_zap() -> int:
diff --git a/meltingpot/python/human_players/play_predator_and_prey.py b/meltingpot/python/human_players/play_predator_and_prey.py
index 22f0afdc..3166b8c8 100644
--- a/meltingpot/python/human_players/play_predator_and_prey.py
+++ b/meltingpot/python/human_players/play_predator_and_prey.py
@@ -24,11 +24,11 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import predator_prey__alley_hunt
-from meltingpot.python.configs.substrates import predator_prey__open
-from meltingpot.python.configs.substrates import predator_prey__orchard
-from meltingpot.python.configs.substrates import predator_prey__random_forest
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import predator_prey__alley_hunt
+from meltingpot.configs.substrates import predator_prey__open
+from meltingpot.configs.substrates import predator_prey__orchard
+from meltingpot.configs.substrates import predator_prey__random_forest
+from meltingpot.human_players import level_playing_utils
 
 
 MAX_SCREEN_WIDTH = 800
diff --git a/meltingpot/python/human_players/play_territory.py b/meltingpot/python/human_players/play_territory.py
index 6eaaf2b7..c2cdcb22 100644
--- a/meltingpot/python/human_players/play_territory.py
+++ b/meltingpot/python/human_players/play_territory.py
@@ -24,10 +24,10 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs.substrates import territory__inside_out
-from meltingpot.python.configs.substrates import territory__open
-from meltingpot.python.configs.substrates import territory__rooms
-from meltingpot.python.human_players import level_playing_utils
+from meltingpot.configs.substrates import territory__inside_out
+from meltingpot.configs.substrates import territory__open
+from meltingpot.configs.substrates import territory__rooms
+from meltingpot.human_players import level_playing_utils
 
 
 environment_configs = {
diff --git a/meltingpot/python/scenario.py b/meltingpot/python/scenario.py
index a5c72d17..47b480e5 100644
--- a/meltingpot/python/scenario.py
+++ b/meltingpot/python/scenario.py
@@ -19,12 +19,12 @@
 
 import immutabledict
 
-from meltingpot.python import bot as mp_bot
-from meltingpot.python import substrate as mp_substrate
-from meltingpot.python.configs import scenarios as scenario_configs
-from meltingpot.python.utils.scenarios import scenario
-from meltingpot.python.utils.scenarios import scenario_factory
-from meltingpot.python.utils.substrates import substrate as substrate_lib
+from meltingpot import bot as mp_bot
+from meltingpot import substrate as mp_substrate
+from meltingpot.configs import scenarios as scenario_configs
+from meltingpot.utils.scenarios import scenario
+from meltingpot.utils.scenarios import scenario_factory
+from meltingpot.utils.substrates import substrate as substrate_lib
 
 SCENARIOS = frozenset(scenario_configs.SCENARIO_CONFIGS)
 
diff --git a/meltingpot/python/scenario_test.py b/meltingpot/python/scenario_test.py
index a35f78d9..1932e0cd 100644
--- a/meltingpot/python/scenario_test.py
+++ b/meltingpot/python/scenario_test.py
@@ -19,8 +19,8 @@
 import dm_env
 import numpy as np
 
-from meltingpot.python import scenario
-from meltingpot.python.testing import substrates as test_utils
+from meltingpot import scenario
+from meltingpot.testing import substrates as test_utils
 
 
 @parameterized.named_parameters((name, name) for name in scenario.SCENARIOS)
diff --git a/meltingpot/python/substrate.py b/meltingpot/python/substrate.py
index 7a3fd011..3e4e47cb 100644
--- a/meltingpot/python/substrate.py
+++ b/meltingpot/python/substrate.py
@@ -17,9 +17,9 @@
 
 from ml_collections import config_dict
 
-from meltingpot.python.configs import substrates as substrate_configs
-from meltingpot.python.utils.substrates import substrate
-from meltingpot.python.utils.substrates import substrate_factory
+from meltingpot.configs import substrates as substrate_configs
+from meltingpot.utils.substrates import substrate
+from meltingpot.utils.substrates import substrate_factory
 
 SUBSTRATES = substrate_configs.SUBSTRATES
 
diff --git a/meltingpot/python/substrate_test.py b/meltingpot/python/substrate_test.py
index 04b9b98b..68a0b37a 100644
--- a/meltingpot/python/substrate_test.py
+++ b/meltingpot/python/substrate_test.py
@@ -19,8 +19,8 @@
 import dm_env
 import numpy as np
 
-from meltingpot.python import substrate
-from meltingpot.python.testing import substrates as test_utils
+from meltingpot import substrate
+from meltingpot.testing import substrates as test_utils
 
 
 @parameterized.named_parameters((name, name) for name in substrate.SUBSTRATES)
diff --git a/meltingpot/python/testing/bots.py b/meltingpot/python/testing/bots.py
index 85e90675..661de9fe 100644
--- a/meltingpot/python/testing/bots.py
+++ b/meltingpot/python/testing/bots.py
@@ -18,7 +18,7 @@
 import dm_env
 import tree
 
-from meltingpot.python.utils.policies import policy as policy_lib
+from meltingpot.utils.policies import policy as policy_lib
 
 
 class BotTestCase(parameterized.TestCase):
diff --git a/meltingpot/python/testing/mocks.py b/meltingpot/python/testing/mocks.py
index d20f3a72..0bee963c 100644
--- a/meltingpot/python/testing/mocks.py
+++ b/meltingpot/python/testing/mocks.py
@@ -22,10 +22,10 @@
 import numpy as np
 import tree
 
-from meltingpot import python as meltingpot
-from meltingpot.python.utils.scenarios import scenario
-from meltingpot.python.utils.substrates import specs as meltingpot_specs
-from meltingpot.python.utils.substrates import substrate
+import meltingpot
+from meltingpot.utils.scenarios import scenario
+from meltingpot.utils.substrates import specs as meltingpot_specs
+from meltingpot.utils.substrates import substrate
 
 SUBSTRATE_OBSERVATION_SPEC = immutabledict.immutabledict({
     # Observations present in all substrates. Sizes may vary.
diff --git a/meltingpot/python/testing/mocks_test.py b/meltingpot/python/testing/mocks_test.py
index 36f837d1..166ad345 100644
--- a/meltingpot/python/testing/mocks_test.py
+++ b/meltingpot/python/testing/mocks_test.py
@@ -15,10 +15,10 @@
 import dm_env
 import numpy as np
 
-from meltingpot.python.testing import mocks
-from meltingpot.python.testing import substrates
-from meltingpot.python.utils.substrates import specs as meltingpot_specs
-from meltingpot.python.utils.substrates import substrate
+from meltingpot.testing import mocks
+from meltingpot.testing import substrates
+from meltingpot.utils.substrates import specs as meltingpot_specs
+from meltingpot.utils.substrates import substrate
 
 
 class MocksTest(substrates.SubstrateTestCase):
diff --git a/meltingpot/python/utils/evaluation/evaluation.py b/meltingpot/python/utils/evaluation/evaluation.py
index 29a8b80d..472b91ab 100644
--- a/meltingpot/python/utils/evaluation/evaluation.py
+++ b/meltingpot/python/utils/evaluation/evaluation.py
@@ -28,12 +28,12 @@
 from reactivex import operators as ops
 from reactivex import subject
 
-from meltingpot import python as meltingpot
-from meltingpot.python.utils.policies import policy as policy_lib
-from meltingpot.python.utils.policies import saved_model_policy
-from meltingpot.python.utils.scenarios import population as population_lib
-from meltingpot.python.utils.scenarios import scenario as scenario_lib
-from meltingpot.python.utils.substrates import substrate as substrate_lib
+import meltingpot
+from meltingpot.utils.policies import policy as policy_lib
+from meltingpot.utils.policies import saved_model_policy
+from meltingpot.utils.scenarios import population as population_lib
+from meltingpot.utils.scenarios import scenario as scenario_lib
+from meltingpot.utils.substrates import substrate as substrate_lib
 
 T = TypeVar('T')
 
diff --git a/meltingpot/python/utils/evaluation/evaluation_test.py b/meltingpot/python/utils/evaluation/evaluation_test.py
index d17b952b..40177083 100644
--- a/meltingpot/python/utils/evaluation/evaluation_test.py
+++ b/meltingpot/python/utils/evaluation/evaluation_test.py
@@ -20,7 +20,7 @@
 import dm_env
 import numpy as np
 
-from meltingpot.python.utils.evaluation import evaluation
+from meltingpot.utils.evaluation import evaluation
 
 
 def _as_timesteps(frames):
diff --git a/meltingpot/python/utils/policies/fixed_action_policy.py b/meltingpot/python/utils/policies/fixed_action_policy.py
index 1433cb87..14ca9661 100644
--- a/meltingpot/python/utils/policies/fixed_action_policy.py
+++ b/meltingpot/python/utils/policies/fixed_action_policy.py
@@ -17,7 +17,7 @@
 
 import dm_env
 
-from meltingpot.python.utils.policies import policy
+from meltingpot.utils.policies import policy
 
 
 class FixedActionPolicy(policy.Policy[Tuple[()]]):
diff --git a/meltingpot/python/utils/policies/policy_factory.py b/meltingpot/python/utils/policies/policy_factory.py
index c306a259..890aa1f6 100644
--- a/meltingpot/python/utils/policies/policy_factory.py
+++ b/meltingpot/python/utils/policies/policy_factory.py
@@ -18,7 +18,7 @@
 
 import dm_env
 
-from meltingpot.python.utils.policies import policy
+from meltingpot.utils.policies import policy
 
 
 class PolicyFactory(metaclass=abc.ABCMeta):
diff --git a/meltingpot/python/utils/policies/puppet_policy.py b/meltingpot/python/utils/policies/puppet_policy.py
index c4ddcb00..37ad4265 100644
--- a/meltingpot/python/utils/policies/puppet_policy.py
+++ b/meltingpot/python/utils/policies/puppet_policy.py
@@ -17,8 +17,8 @@
 
 import dm_env
 
-from meltingpot.python.utils.policies import policy
-from meltingpot.python.utils.puppeteers import puppeteer as puppeteer_lib
+from meltingpot.utils.policies import policy
+from meltingpot.utils.puppeteers import puppeteer as puppeteer_lib
 
 PuppeteerState = TypeVar('PuppeteerState')
 PolicyState = TypeVar('PolicyState')
diff --git a/meltingpot/python/utils/policies/saved_model_policy.py b/meltingpot/python/utils/policies/saved_model_policy.py
index 4ad81b53..8df461f3 100644
--- a/meltingpot/python/utils/policies/saved_model_policy.py
+++ b/meltingpot/python/utils/policies/saved_model_policy.py
@@ -21,8 +21,8 @@
 import tensorflow as tf
 import tree
 
-from meltingpot.python.utils.policies import permissive_model
-from meltingpot.python.utils.policies import policy
+from meltingpot.utils.policies import permissive_model
+from meltingpot.utils.policies import policy
 
 
 def _numpy_to_placeholder(
diff --git a/meltingpot/python/utils/puppeteers/alternator.py b/meltingpot/python/utils/puppeteers/alternator.py
index 2dfbe0b7..85a7bc11 100644
--- a/meltingpot/python/utils/puppeteers/alternator.py
+++ b/meltingpot/python/utils/puppeteers/alternator.py
@@ -17,7 +17,7 @@
 
 import dm_env
 
-from meltingpot.python.utils.puppeteers import puppeteer
+from meltingpot.utils.puppeteers import puppeteer
 
 
 class Alternator(puppeteer.Puppeteer[int]):
diff --git a/meltingpot/python/utils/puppeteers/alternator_test.py b/meltingpot/python/utils/puppeteers/alternator_test.py
index 914bcc3f..544b1cb0 100644
--- a/meltingpot/python/utils/puppeteers/alternator_test.py
+++ b/meltingpot/python/utils/puppeteers/alternator_test.py
@@ -18,8 +18,8 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.utils.puppeteers import alternator
-from meltingpot.python.utils.puppeteers import testutils
+from meltingpot.utils.puppeteers import alternator
+from meltingpot.utils.puppeteers import testutils
 
 _GOAL_A = mock.sentinel.goal_a
 _GOAL_B = mock.sentinel.goal_b
diff --git a/meltingpot/python/utils/puppeteers/clean_up.py b/meltingpot/python/utils/puppeteers/clean_up.py
index c6fa2f06..c50ae90a 100644
--- a/meltingpot/python/utils/puppeteers/clean_up.py
+++ b/meltingpot/python/utils/puppeteers/clean_up.py
@@ -17,7 +17,7 @@
 
 import dm_env
 
-from meltingpot.python.utils.puppeteers import puppeteer
+from meltingpot.utils.puppeteers import puppeteer
 
 
 @dataclasses.dataclass(frozen=True)
diff --git a/meltingpot/python/utils/puppeteers/clean_up_test.py b/meltingpot/python/utils/puppeteers/clean_up_test.py
index 6efb96a3..d2868703 100644
--- a/meltingpot/python/utils/puppeteers/clean_up_test.py
+++ b/meltingpot/python/utils/puppeteers/clean_up_test.py
@@ -18,8 +18,8 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.utils.puppeteers import clean_up
-from meltingpot.python.utils.puppeteers import testutils
+from meltingpot.utils.puppeteers import clean_up
+from meltingpot.utils.puppeteers import testutils
 
 _NUM_COOPERATORS_KEY = 'num_cooperators'
 _COOPERATE = mock.sentinel.cooperate
diff --git a/meltingpot/python/utils/puppeteers/coins.py b/meltingpot/python/utils/puppeteers/coins.py
index c981c23a..4515a3ca 100644
--- a/meltingpot/python/utils/puppeteers/coins.py
+++ b/meltingpot/python/utils/puppeteers/coins.py
@@ -17,7 +17,7 @@
 
 import dm_env
 
-from meltingpot.python.utils.puppeteers import puppeteer
+from meltingpot.utils.puppeteers import puppeteer
 
 
 @dataclasses.dataclass(frozen=True)
diff --git a/meltingpot/python/utils/puppeteers/coins_test.py b/meltingpot/python/utils/puppeteers/coins_test.py
index 936c5f64..17ff7d2f 100644
--- a/meltingpot/python/utils/puppeteers/coins_test.py
+++ b/meltingpot/python/utils/puppeteers/coins_test.py
@@ -18,8 +18,8 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.utils.puppeteers import coins
-from meltingpot.python.utils.puppeteers import testutils
+from meltingpot.utils.puppeteers import coins
+from meltingpot.utils.puppeteers import testutils
 
 _COOPERATE = mock.sentinel.cooperate
 _DEFECT = mock.sentinel.defect
diff --git a/meltingpot/python/utils/puppeteers/coordination_in_the_matrix.py b/meltingpot/python/utils/puppeteers/coordination_in_the_matrix.py
index 6859aca2..9f57a03a 100644
--- a/meltingpot/python/utils/puppeteers/coordination_in_the_matrix.py
+++ b/meltingpot/python/utils/puppeteers/coordination_in_the_matrix.py
@@ -15,7 +15,7 @@
 
 from typing import Iterable
 
-from meltingpot.python.utils.puppeteers import in_the_matrix
+from meltingpot.utils.puppeteers import in_the_matrix
 
 
 class CoordinateWithPrevious(in_the_matrix.RespondToPrevious):
diff --git a/meltingpot/python/utils/puppeteers/coordination_in_the_matrix_test.py b/meltingpot/python/utils/puppeteers/coordination_in_the_matrix_test.py
index 0f379f19..16138d00 100644
--- a/meltingpot/python/utils/puppeteers/coordination_in_the_matrix_test.py
+++ b/meltingpot/python/utils/puppeteers/coordination_in_the_matrix_test.py
@@ -20,9 +20,9 @@
 from absl.testing import parameterized
 import numpy as np
 
-from meltingpot.python.utils.puppeteers import coordination_in_the_matrix
-from meltingpot.python.utils.puppeteers import in_the_matrix
-from meltingpot.python.utils.puppeteers import testutils
+from meltingpot.utils.puppeteers import coordination_in_the_matrix
+from meltingpot.utils.puppeteers import in_the_matrix
+from meltingpot.utils.puppeteers import testutils
 
 _RESOURCE_A = in_the_matrix.Resource(
     index=0,
diff --git a/meltingpot/python/utils/puppeteers/fixed_goal.py b/meltingpot/python/utils/puppeteers/fixed_goal.py
index dd462759..d35bf75d 100644
--- a/meltingpot/python/utils/puppeteers/fixed_goal.py
+++ b/meltingpot/python/utils/puppeteers/fixed_goal.py
@@ -15,7 +15,7 @@
 
 import dm_env
 
-from meltingpot.python.utils.puppeteers import puppeteer
+from meltingpot.utils.puppeteers import puppeteer
 
 
 class FixedGoal(puppeteer.Puppeteer[tuple[()]]):
diff --git a/meltingpot/python/utils/puppeteers/fixed_goal_test.py b/meltingpot/python/utils/puppeteers/fixed_goal_test.py
index a1402977..3b8485d8 100644
--- a/meltingpot/python/utils/puppeteers/fixed_goal_test.py
+++ b/meltingpot/python/utils/puppeteers/fixed_goal_test.py
@@ -18,8 +18,8 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.utils.puppeteers import fixed_goal
-from meltingpot.python.utils.puppeteers import testutils
+from meltingpot.utils.puppeteers import fixed_goal
+from meltingpot.utils.puppeteers import testutils
 
 
 class FixedGoalTest(parameterized.TestCase):
diff --git a/meltingpot/python/utils/puppeteers/gift_refinements.py b/meltingpot/python/utils/puppeteers/gift_refinements.py
index c5794678..a73a7bba 100644
--- a/meltingpot/python/utils/puppeteers/gift_refinements.py
+++ b/meltingpot/python/utils/puppeteers/gift_refinements.py
@@ -19,7 +19,7 @@
 import numpy as np
 import tree
 
-from meltingpot.python.utils.puppeteers import puppeteer
+from meltingpot.utils.puppeteers import puppeteer
 
 Observation = Mapping[str, tree.Structure[np.ndarray]]
 
diff --git a/meltingpot/python/utils/puppeteers/gift_refinements_test.py b/meltingpot/python/utils/puppeteers/gift_refinements_test.py
index c6be1d1b..418f205b 100644
--- a/meltingpot/python/utils/puppeteers/gift_refinements_test.py
+++ b/meltingpot/python/utils/puppeteers/gift_refinements_test.py
@@ -18,8 +18,8 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.utils.puppeteers import gift_refinements
-from meltingpot.python.utils.puppeteers import testutils
+from meltingpot.utils.puppeteers import gift_refinements
+from meltingpot.utils.puppeteers import testutils
 
 _COLLECT = mock.sentinel.collect
 _CONSUME = mock.sentinel.consume
diff --git a/meltingpot/python/utils/puppeteers/in_the_matrix.py b/meltingpot/python/utils/puppeteers/in_the_matrix.py
index 898da8a6..016fd848 100644
--- a/meltingpot/python/utils/puppeteers/in_the_matrix.py
+++ b/meltingpot/python/utils/puppeteers/in_the_matrix.py
@@ -22,7 +22,7 @@
 import numpy as np
 import tree
 
-from meltingpot.python.utils.puppeteers import puppeteer
+from meltingpot.utils.puppeteers import puppeteer
 
 State = TypeVar("State")
 Observation = Mapping[str, tree.Structure[np.ndarray]]
diff --git a/meltingpot/python/utils/puppeteers/in_the_matrix_test.py b/meltingpot/python/utils/puppeteers/in_the_matrix_test.py
index c4dd4065..f75a76ae 100644
--- a/meltingpot/python/utils/puppeteers/in_the_matrix_test.py
+++ b/meltingpot/python/utils/puppeteers/in_the_matrix_test.py
@@ -22,8 +22,8 @@
 import immutabledict
 import numpy as np
 
-from meltingpot.python.utils.puppeteers import in_the_matrix
-from meltingpot.python.utils.puppeteers import testutils
+from meltingpot.utils.puppeteers import in_the_matrix
+from meltingpot.utils.puppeteers import testutils
 
 _RESOURCE_0 = in_the_matrix.Resource(
     index=0,
diff --git a/meltingpot/python/utils/puppeteers/running_with_scissors_in_the_matrix.py b/meltingpot/python/utils/puppeteers/running_with_scissors_in_the_matrix.py
index 840cddb4..8572e74f 100644
--- a/meltingpot/python/utils/puppeteers/running_with_scissors_in_the_matrix.py
+++ b/meltingpot/python/utils/puppeteers/running_with_scissors_in_the_matrix.py
@@ -13,7 +13,7 @@
 # limitations under the License.
 """Puppeteers for running_with_scissors_in_the_matrix."""
 
-from meltingpot.python.utils.puppeteers import in_the_matrix
+from meltingpot.utils.puppeteers import in_the_matrix
 
 
 class CounterPrevious(in_the_matrix.RespondToPrevious):
diff --git a/meltingpot/python/utils/puppeteers/running_with_scissors_in_the_matrix_test.py b/meltingpot/python/utils/puppeteers/running_with_scissors_in_the_matrix_test.py
index c06ed967..c4e9e2f9 100644
--- a/meltingpot/python/utils/puppeteers/running_with_scissors_in_the_matrix_test.py
+++ b/meltingpot/python/utils/puppeteers/running_with_scissors_in_the_matrix_test.py
@@ -20,9 +20,9 @@
 from absl.testing import parameterized
 import numpy as np
 
-from meltingpot.python.utils.puppeteers import in_the_matrix
-from meltingpot.python.utils.puppeteers import running_with_scissors_in_the_matrix
-from meltingpot.python.utils.puppeteers import testutils
+from meltingpot.utils.puppeteers import in_the_matrix
+from meltingpot.utils.puppeteers import running_with_scissors_in_the_matrix
+from meltingpot.utils.puppeteers import testutils
 
 _ROCK = in_the_matrix.Resource(
     index=2,
diff --git a/meltingpot/python/utils/puppeteers/testutils.py b/meltingpot/python/utils/puppeteers/testutils.py
index 6a96ec1b..26632dd2 100644
--- a/meltingpot/python/utils/puppeteers/testutils.py
+++ b/meltingpot/python/utils/puppeteers/testutils.py
@@ -17,7 +17,7 @@
 
 import dm_env
 
-from meltingpot.python.utils.puppeteers import puppeteer as puppeteer_lib
+from meltingpot.utils.puppeteers import puppeteer as puppeteer_lib
 
 GOAL_KEY = puppeteer_lib._GOAL_OBSERVATION_KEY  # pylint: disable=protected-access
 State = TypeVar('State')
diff --git a/meltingpot/python/utils/scenarios/population.py b/meltingpot/python/utils/scenarios/population.py
index 8b6671ba..747530b8 100644
--- a/meltingpot/python/utils/scenarios/population.py
+++ b/meltingpot/python/utils/scenarios/population.py
@@ -23,7 +23,7 @@
 import reactivex
 from reactivex import subject
 
-from meltingpot.python.utils.policies import policy as policy_lib
+from meltingpot.utils.policies import policy as policy_lib
 
 
 def _step_fn(policy: policy_lib.Policy,
diff --git a/meltingpot/python/utils/scenarios/scenario.py b/meltingpot/python/utils/scenarios/scenario.py
index e11dcf4f..b692f21e 100644
--- a/meltingpot/python/utils/scenarios/scenario.py
+++ b/meltingpot/python/utils/scenarios/scenario.py
@@ -23,10 +23,10 @@
 import reactivex
 from reactivex import subject
 
-from meltingpot.python.utils.policies import policy
-from meltingpot.python.utils.scenarios import population
-from meltingpot.python.utils.substrates import substrate as substrate_lib
-from meltingpot.python.utils.substrates.wrappers import observables
+from meltingpot.utils.policies import policy
+from meltingpot.utils.scenarios import population
+from meltingpot.utils.substrates import substrate as substrate_lib
+from meltingpot.utils.substrates.wrappers import observables
 
 T = TypeVar('T')
 
diff --git a/meltingpot/python/utils/scenarios/scenario_factory.py b/meltingpot/python/utils/scenarios/scenario_factory.py
index 7b28a84b..64b5f87f 100644
--- a/meltingpot/python/utils/scenarios/scenario_factory.py
+++ b/meltingpot/python/utils/scenarios/scenario_factory.py
@@ -19,10 +19,10 @@
 import dm_env
 import immutabledict
 
-from meltingpot.python.utils.policies import policy_factory
-from meltingpot.python.utils.scenarios import scenario as scenario_lib
-from meltingpot.python.utils.substrates import substrate as substrate_lib
-from meltingpot.python.utils.substrates import substrate_factory
+from meltingpot.utils.policies import policy_factory
+from meltingpot.utils.scenarios import scenario as scenario_lib
+from meltingpot.utils.substrates import substrate as substrate_lib
+from meltingpot.utils.substrates import substrate_factory
 
 SubstrateTransform = Callable[[substrate_lib.Substrate],
                               substrate_lib.Substrate]
diff --git a/meltingpot/python/utils/scenarios/scenario_test.py b/meltingpot/python/utils/scenarios/scenario_test.py
index 1efef31d..2c1f7079 100644
--- a/meltingpot/python/utils/scenarios/scenario_test.py
+++ b/meltingpot/python/utils/scenarios/scenario_test.py
@@ -20,10 +20,10 @@
 import dm_env
 import immutabledict
 
-from meltingpot.python.utils.policies import policy
-from meltingpot.python.utils.scenarios import population
-from meltingpot.python.utils.scenarios import scenario as scenario_utils
-from meltingpot.python.utils.substrates import substrate as substrate_lib
+from meltingpot.utils.policies import policy
+from meltingpot.utils.scenarios import population
+from meltingpot.utils.scenarios import scenario as scenario_utils
+from meltingpot.utils.substrates import substrate as substrate_lib
 
 
 def _track(source, fields):
diff --git a/meltingpot/python/utils/substrates/builder.py b/meltingpot/python/utils/substrates/builder.py
index 2eaf0faf..d8270929 100644
--- a/meltingpot/python/utils/substrates/builder.py
+++ b/meltingpot/python/utils/substrates/builder.py
@@ -27,8 +27,8 @@
 import dmlab2d
 from dmlab2d import runfiles_helper
 from dmlab2d import settings_helper
-from meltingpot.python.utils.substrates import game_object_utils
-from meltingpot.python.utils.substrates.wrappers import reset_wrapper
+from meltingpot.utils.substrates import game_object_utils
+from meltingpot.utils.substrates.wrappers import reset_wrapper
 
 
 Settings = Union[config_dict.ConfigDict, Mapping[str, Any]]
@@ -39,7 +39,7 @@
 
 def _find_root() -> str:
   import re  # pylint: disable=g-import-not-at-top
-  return re.sub('meltingpot/python/.*', '', __file__)
+  return re.sub('meltingpot/.*?$', '', __file__)
 
 
 _MELTINGPOT_ROOT = _find_root()
diff --git a/meltingpot/python/utils/substrates/builder_test.py b/meltingpot/python/utils/substrates/builder_test.py
index 4eeb8c41..50ae90bd 100644
--- a/meltingpot/python/utils/substrates/builder_test.py
+++ b/meltingpot/python/utils/substrates/builder_test.py
@@ -19,8 +19,8 @@
 from absl.testing import parameterized
 import numpy as np
 
-from meltingpot.python.configs.substrates import running_with_scissors_in_the_matrix__repeated as test_substrate
-from meltingpot.python.utils.substrates import builder
+from meltingpot.configs.substrates import running_with_scissors_in_the_matrix__repeated as test_substrate
+from meltingpot.utils.substrates import builder
 
 
 def _get_test_settings():
diff --git a/meltingpot/python/utils/substrates/game_object_utils.py b/meltingpot/python/utils/substrates/game_object_utils.py
index 252c571d..5208ef4a 100644
--- a/meltingpot/python/utils/substrates/game_object_utils.py
+++ b/meltingpot/python/utils/substrates/game_object_utils.py
@@ -19,8 +19,8 @@
 
 import numpy as np
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
 
 
 # Type of a GameObject prefab configuration: A recursive string mapping.
diff --git a/meltingpot/python/utils/substrates/game_object_utils_test.py b/meltingpot/python/utils/substrates/game_object_utils_test.py
index f03c38df..cf492935 100644
--- a/meltingpot/python/utils/substrates/game_object_utils_test.py
+++ b/meltingpot/python/utils/substrates/game_object_utils_test.py
@@ -16,7 +16,7 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.utils.substrates import game_object_utils
+from meltingpot.utils.substrates import game_object_utils
 
 
 def get_transform(x, y, orientation):
diff --git a/meltingpot/python/utils/substrates/reaction_graph_utils.py b/meltingpot/python/utils/substrates/reaction_graph_utils.py
index a696327f..128c6678 100644
--- a/meltingpot/python/utils/substrates/reaction_graph_utils.py
+++ b/meltingpot/python/utils/substrates/reaction_graph_utils.py
@@ -19,8 +19,8 @@
 import networkx as nx  # pylint: disable=unused-import
 import numpy as np
 
-from meltingpot.python.utils.substrates import colors
-from meltingpot.python.utils.substrates import shapes
+from meltingpot.utils.substrates import colors
+from meltingpot.utils.substrates import shapes
 
 EARTH_COLOR = (225, 169, 95, 255)  # An earth color.
 WHITE_COLOR = (255, 255, 255, 255)  # A white color.
diff --git a/meltingpot/python/utils/substrates/shapes_test.py b/meltingpot/python/utils/substrates/shapes_test.py
index b70b343d..fdc9532c 100644
--- a/meltingpot/python/utils/substrates/shapes_test.py
+++ b/meltingpot/python/utils/substrates/shapes_test.py
@@ -16,7 +16,7 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.utils.substrates import shapes
+from meltingpot.utils.substrates import shapes
 
 
 class ShapesTest(parameterized.TestCase):
diff --git a/meltingpot/python/utils/substrates/substrate.py b/meltingpot/python/utils/substrates/substrate.py
index ab868d74..69191a64 100644
--- a/meltingpot/python/utils/substrates/substrate.py
+++ b/meltingpot/python/utils/substrates/substrate.py
@@ -21,13 +21,13 @@
 import reactivex
 from reactivex import subject
 
-from meltingpot.python.utils.substrates import builder
-from meltingpot.python.utils.substrates.wrappers import base
-from meltingpot.python.utils.substrates.wrappers import collective_reward_wrapper
-from meltingpot.python.utils.substrates.wrappers import discrete_action_wrapper
-from meltingpot.python.utils.substrates.wrappers import multiplayer_wrapper
-from meltingpot.python.utils.substrates.wrappers import observables
-from meltingpot.python.utils.substrates.wrappers import observables_wrapper
+from meltingpot.utils.substrates import builder
+from meltingpot.utils.substrates.wrappers import base
+from meltingpot.utils.substrates.wrappers import collective_reward_wrapper
+from meltingpot.utils.substrates.wrappers import discrete_action_wrapper
+from meltingpot.utils.substrates.wrappers import multiplayer_wrapper
+from meltingpot.utils.substrates.wrappers import observables
+from meltingpot.utils.substrates.wrappers import observables_wrapper
 
 
 @chex.dataclass(frozen=True)
diff --git a/meltingpot/python/utils/substrates/substrate_factory.py b/meltingpot/python/utils/substrates/substrate_factory.py
index f5766feb..d3bc124a 100644
--- a/meltingpot/python/utils/substrates/substrate_factory.py
+++ b/meltingpot/python/utils/substrates/substrate_factory.py
@@ -18,8 +18,8 @@
 
 import dm_env
 
-from meltingpot.python.utils.substrates import builder
-from meltingpot.python.utils.substrates import substrate
+from meltingpot.utils.substrates import builder
+from meltingpot.utils.substrates import substrate
 
 
 class SubstrateFactory:
diff --git a/meltingpot/python/utils/substrates/substrate_test.py b/meltingpot/python/utils/substrates/substrate_test.py
index 806b7cc0..98587f40 100644
--- a/meltingpot/python/utils/substrates/substrate_test.py
+++ b/meltingpot/python/utils/substrates/substrate_test.py
@@ -19,8 +19,8 @@
 from absl.testing import absltest
 from absl.testing import parameterized
 
-from meltingpot.python.utils.substrates import substrate
-from meltingpot.python.utils.substrates.wrappers import observables as observables_lib
+from meltingpot.utils.substrates import substrate
+from meltingpot.utils.substrates.wrappers import observables as observables_lib
 
 
 class SubstrateTest(parameterized.TestCase):
diff --git a/meltingpot/python/utils/substrates/wrappers/base_test.py b/meltingpot/python/utils/substrates/wrappers/base_test.py
index b53720ad..52585c71 100644
--- a/meltingpot/python/utils/substrates/wrappers/base_test.py
+++ b/meltingpot/python/utils/substrates/wrappers/base_test.py
@@ -20,7 +20,7 @@
 from absl.testing import parameterized
 
 import dmlab2d
-from meltingpot.python.utils.substrates.wrappers import base
+from meltingpot.utils.substrates.wrappers import base
 
 _WRAPPED_METHODS = tuple([
     name for name, _ in inspect.getmembers(dmlab2d.Environment)
diff --git a/meltingpot/python/utils/substrates/wrappers/collective_reward_wrapper.py b/meltingpot/python/utils/substrates/wrappers/collective_reward_wrapper.py
index c9f6fab6..0e9bd1a0 100644
--- a/meltingpot/python/utils/substrates/wrappers/collective_reward_wrapper.py
+++ b/meltingpot/python/utils/substrates/wrappers/collective_reward_wrapper.py
@@ -19,7 +19,7 @@
 import dm_env
 import numpy as np
 
-from meltingpot.python.utils.substrates.wrappers import observables
+from meltingpot.utils.substrates.wrappers import observables
 
 
 T = TypeVar("T")
diff --git a/meltingpot/python/utils/substrates/wrappers/collective_reward_wrapper_test.py b/meltingpot/python/utils/substrates/wrappers/collective_reward_wrapper_test.py
index 601c15f5..8b2535cd 100644
--- a/meltingpot/python/utils/substrates/wrappers/collective_reward_wrapper_test.py
+++ b/meltingpot/python/utils/substrates/wrappers/collective_reward_wrapper_test.py
@@ -21,7 +21,7 @@
 import numpy as np
 
 import dmlab2d
-from meltingpot.python.utils.substrates.wrappers import collective_reward_wrapper
+from meltingpot.utils.substrates.wrappers import collective_reward_wrapper
 
 RGB_SPEC = dm_env.specs.Array(shape=(2, 1), dtype=np.int8)
 COLLECTIVE_REWARD_SPEC = dm_env.specs.Array(shape=(), dtype=np.float64)
diff --git a/meltingpot/python/utils/substrates/wrappers/discrete_action_wrapper.py b/meltingpot/python/utils/substrates/wrappers/discrete_action_wrapper.py
index 9815e1d0..02ce4fd8 100644
--- a/meltingpot/python/utils/substrates/wrappers/discrete_action_wrapper.py
+++ b/meltingpot/python/utils/substrates/wrappers/discrete_action_wrapper.py
@@ -20,7 +20,7 @@
 import immutabledict
 import numpy as np
 
-from meltingpot.python.utils.substrates.wrappers import observables
+from meltingpot.utils.substrates.wrappers import observables
 
 T = TypeVar('T')
 Numeric = Union[int, float, np.ndarray]
diff --git a/meltingpot/python/utils/substrates/wrappers/discrete_action_wrapper_test.py b/meltingpot/python/utils/substrates/wrappers/discrete_action_wrapper_test.py
index eb391b64..e768a298 100644
--- a/meltingpot/python/utils/substrates/wrappers/discrete_action_wrapper_test.py
+++ b/meltingpot/python/utils/substrates/wrappers/discrete_action_wrapper_test.py
@@ -22,7 +22,7 @@
 import numpy as np
 
 import dmlab2d
-from meltingpot.python.utils.substrates.wrappers import discrete_action_wrapper
+from meltingpot.utils.substrates.wrappers import discrete_action_wrapper
 
 MOVE_SPEC = dm_env.specs.BoundedArray(
     shape=(), minimum=0, maximum=3, dtype=np.int8, name='MOVE')
diff --git a/meltingpot/python/utils/substrates/wrappers/multiplayer_wrapper.py b/meltingpot/python/utils/substrates/wrappers/multiplayer_wrapper.py
index 1ccc31aa..642482c4 100644
--- a/meltingpot/python/utils/substrates/wrappers/multiplayer_wrapper.py
+++ b/meltingpot/python/utils/substrates/wrappers/multiplayer_wrapper.py
@@ -19,7 +19,7 @@
 import dm_env
 import numpy as np
 
-from meltingpot.python.utils.substrates.wrappers import observables
+from meltingpot.utils.substrates.wrappers import observables
 
 T = TypeVar("T")
 
diff --git a/meltingpot/python/utils/substrates/wrappers/multiplayer_wrapper_test.py b/meltingpot/python/utils/substrates/wrappers/multiplayer_wrapper_test.py
index da36e6ed..1d86367d 100644
--- a/meltingpot/python/utils/substrates/wrappers/multiplayer_wrapper_test.py
+++ b/meltingpot/python/utils/substrates/wrappers/multiplayer_wrapper_test.py
@@ -21,7 +21,7 @@
 import numpy as np
 
 import dmlab2d
-from meltingpot.python.utils.substrates.wrappers import multiplayer_wrapper
+from meltingpot.utils.substrates.wrappers import multiplayer_wrapper
 
 ACT_SPEC = dm_env.specs.BoundedArray(
     shape=(), minimum=0, maximum=4, dtype=np.int8)
diff --git a/meltingpot/python/utils/substrates/wrappers/observables.py b/meltingpot/python/utils/substrates/wrappers/observables.py
index 7de96ea8..9b474250 100644
--- a/meltingpot/python/utils/substrates/wrappers/observables.py
+++ b/meltingpot/python/utils/substrates/wrappers/observables.py
@@ -28,7 +28,7 @@
 import reactivex
 
 import dmlab2d
-from meltingpot.python.utils.substrates.wrappers import base
+from meltingpot.utils.substrates.wrappers import base
 
 
 @chex.dataclass(frozen=True)
diff --git a/meltingpot/python/utils/substrates/wrappers/observables_wrapper.py b/meltingpot/python/utils/substrates/wrappers/observables_wrapper.py
index 347b4343..ef877ab9 100644
--- a/meltingpot/python/utils/substrates/wrappers/observables_wrapper.py
+++ b/meltingpot/python/utils/substrates/wrappers/observables_wrapper.py
@@ -20,7 +20,7 @@
 from reactivex import subject
 
 import dmlab2d
-from meltingpot.python.utils.substrates.wrappers import observables
+from meltingpot.utils.substrates.wrappers import observables
 
 
 Action = Union[int, float, np.ndarray]
diff --git a/meltingpot/python/utils/substrates/wrappers/observables_wrapper_test.py b/meltingpot/python/utils/substrates/wrappers/observables_wrapper_test.py
index 1c374355..f512687c 100644
--- a/meltingpot/python/utils/substrates/wrappers/observables_wrapper_test.py
+++ b/meltingpot/python/utils/substrates/wrappers/observables_wrapper_test.py
@@ -20,7 +20,7 @@
 from absl.testing import parameterized
 
 import dmlab2d
-from meltingpot.python.utils.substrates.wrappers import observables_wrapper
+from meltingpot.utils.substrates.wrappers import observables_wrapper
 
 
 class ObservablesWrapperTest(parameterized.TestCase):
diff --git a/meltingpot/python/utils/substrates/wrappers/reset_wrapper.py b/meltingpot/python/utils/substrates/wrappers/reset_wrapper.py
index 8fa34988..f52c75f8 100644
--- a/meltingpot/python/utils/substrates/wrappers/reset_wrapper.py
+++ b/meltingpot/python/utils/substrates/wrappers/reset_wrapper.py
@@ -18,7 +18,7 @@
 import dm_env
 
 import dmlab2d
-from meltingpot.python.utils.substrates.wrappers import base
+from meltingpot.utils.substrates.wrappers import base
 
 
 class ResetWrapper(base.Lab2dWrapper):
diff --git a/setup.py b/setup.py
index 7f9f3fb2..080c75a5 100644
--- a/setup.py
+++ b/setup.py
@@ -51,7 +51,8 @@ def download_and_extract_assets(self):
       urllib.request.urlretrieve(ASSETS_URL, filename=tar_file_path)
       print(f'downloaded {tar_file_path}', flush=True)
 
-    root = self.get_package_dir('meltingpot')
+    root = os.path.join(self.get_package_dir(''), 'meltingpot')
+    os.makedirs(root, exist_ok=True)
     if os.path.exists(f'{root}/assets'):
       shutil.rmtree(f'{root}/assets')
       print('deleted existing assets', flush=True)
@@ -61,7 +62,8 @@ def download_and_extract_assets(self):
 
   def build_assets(self):
     """Copies assets from package to build lib."""
-    package_root = self.get_package_dir('meltingpot')
+    package_root = os.path.join(self.get_package_dir(''), 'meltingpot')
+    os.makedirs(package_root, exist_ok=True)
     build_root = os.path.join(self.build_lib, 'meltingpot')
     if os.path.exists(f'{build_root}/assets'):
       shutil.rmtree(f'{build_root}/assets')
@@ -95,12 +97,12 @@ def build_assets(self):
         'Topic :: Scientific/Engineering :: Artificial Intelligence',
     ],
     cmdclass={'build_py': BuildPy},
-    package_dir={'meltingpot': 'meltingpot'},
+    package_dir={
+        'meltingpot': 'meltingpot/python',
+        'meltingpot.lua': 'meltingpot/lua',
+    },
     package_data={
-        'meltingpot': [
-            'lua/modules/*',
-            'lua/levels/**/*',
-        ],
+        'meltingpot.lua': ['**'],
     },
     python_requires='>=3.9',
     install_requires=[