From 3e92a6b2bb819ecd612d92b15f4390aab6a2eb89 Mon Sep 17 00:00:00 2001 From: mhucka Date: Tue, 13 Oct 2026 04:10:44 +0000 Subject: [PATCH] Limit version of IPython to < 9.17.0 Kera's `plot_model` function has a check for whether graphviz is installed. If it is not installed, `plot_model` does one of two things depending on whether "IPython.core.magics.namespace" is present in `sys.modules`: if it is present, `plot_model` prints a message; if it is not present, it raises an `ImportError`. Unfortunately, starting in IPython 9.17.0:(upstream commit 7f0ee55684f0, "Declare IPython's built-in magics lazily"), IPython no longer eagerly imports `IPython.core.magics.*` modules (including "IPython.core.magics.namespace") at kernel startup. The script `ci_validate_tutorials.sh` does pip-installs ipython, but it set a lower version limit, not an upper version limit. So now when the script runs, it installs IPython >= 9.17.0 and we get `ImportError` during notebook validation. The simplest solution is to set the upper bound on the version, which is what this PR does. --- scripts/ci_validate_tutorials.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci_validate_tutorials.sh b/scripts/ci_validate_tutorials.sh index f1294f65b..247ba899b 100755 --- a/scripts/ci_validate_tutorials.sh +++ b/scripts/ci_validate_tutorials.sh @@ -23,7 +23,7 @@ export TF_USE_LEGACY_KERAS=1 pip install \ "nbclient==0.6.5" \ "jupyter-client==7.4.9" \ - "ipython>=8.10.0" \ + "ipython>=8.10.0,<9.17.0" \ "ipykernel>=6.29.0" # Gymnasium pip package needed for the quantum reinforcement learning tutorial