diff --git a/panel/config.py b/panel/config.py index 903e38c256..0fef4e6ebb 100644 --- a/panel/config.py +++ b/panel/config.py @@ -787,12 +787,9 @@ def _detect_comms(self, params): return # Try to detect environment so that we can enable comms - try: - import google.colab # noqa + if "google.colab" in sys.modules: config.comms = "colab" return - except ImportError: - pass if "VSCODE_CWD" in os.environ or "VSCODE_PID" in os.environ: config.comms = "vscode"