Repository navigation
Commit 2df92a8
authored
Limit version of IPython to < 9.17.0 to avoid import error during notebook validation (#1118)
Some of the notebooks use Kera's `plot_model` function. That function
has a check for whether graphviz is installed. If it is _not_ installed,
`plot_model` then tests whether "IPython.core.magics.namespace" is
present in `sys.modules` and does one of two things: if it's present,
`plot_model` prints a message; if it is not present, it raises an
`ImportError`. Unfortunately, starting in IPython 9.17.0, IPython no
longer eagerly imports `IPython.core.magics.*` modules at startup.
Unless Graphviz is installed separately in the run-time environment,
calling `plot_model` will raise an `ImportError`.
Our notebook checks are done using our script
`ci_validate_tutorials.sh`, and that script pip-installs IPython, but it
only sets a lower bound on the version number. As a result, when the
script executes in CI, it installs a version of IPython >= 9.17.0, which
leads `plot_model` to fail the test for "IPython.core.magics.namespace",
which leads it to raise `ImportError` in CI.
The simplest solution is to add an upper bound on the version number in
`ci_validate_tutorials.sh`, which is what this PR does. This will solve
the CI failures and also help any users who may encounter the same
problem when testing notebooks locally.1 parent 9e378d1 commit 2df92a8
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments