diff --git a/mesa/experimental/jupyter_viz.py b/mesa/experimental/jupyter_viz.py index d0843448906..c34a3d9fef3 100644 --- a/mesa/experimental/jupyter_viz.py +++ b/mesa/experimental/jupyter_viz.py @@ -152,7 +152,8 @@ def render_in_browser(): on_grid_layout=set_grid_layout, ) - if "ipykernel" in sys.argv[0]: + if ("ipykernel" in sys.argv[0]) or ("colab_kernel_launcher.py" in sys.argv[0]): + # When in Jupyter or Google Colab render_in_jupyter() else: render_in_browser()