From 4f87488d4fc24a7ec255c11f2c6f863b7e51d0d3 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 24 Feb 2025 14:01:50 -0500 Subject: [PATCH 1/4] DOC: document the issues with overlaying new mpl on old mpl closes #26827 --- .../api_changes_3.8.0/behaviour.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst b/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst index 0b598723e26c..43200757947c 100644 --- a/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst +++ b/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst @@ -171,3 +171,18 @@ saved. Previously, *mincnt* was inclusive with no *C* provided but exclusive when *C* is provided. It is now inclusive of *mincnt* in both cases. + + +``matplotlib.mpl_toolkits`` is now an implicit namespace package +---------------------------------------------------------------- + +Following the deprecation of ``pkg_resources.declare_namespace`` in ``setuptools`` 67.3.0, +``matplotlib.mpl_toolkits`` is now implemented as an implicit namespace, following +`PEP 420 `_. + +As a consequence using ``pip`` to install a version of Matplotlib >= 3.8 on top +of a version of Matplotlib < 3.8 (e.g. via ``pip install --local`` or +``python -m venv --system-site-packages ...``) will fail because the old +`matplotlib.mpl_toolkits` files will be found where as the newer files will be +found for all other modules. This will result in errors due to the version +miss-match. From 96c5403f251954233750788e9f85a8dfd091de7e Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 24 Feb 2025 17:14:17 -0500 Subject: [PATCH 2/4] DOC: add note about how to avoid overlaying multiple versions of mpl --- doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst b/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst index 43200757947c..ccba751f975d 100644 --- a/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst +++ b/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst @@ -183,6 +183,10 @@ Following the deprecation of ``pkg_resources.declare_namespace`` in ``setuptools As a consequence using ``pip`` to install a version of Matplotlib >= 3.8 on top of a version of Matplotlib < 3.8 (e.g. via ``pip install --local`` or ``python -m venv --system-site-packages ...``) will fail because the old -`matplotlib.mpl_toolkits` files will be found where as the newer files will be +``matplotlib.mpl_toolkits`` files will be found where as the newer files will be found for all other modules. This will result in errors due to the version miss-match. + +To avoid this issue you need to avoid having multiple versions of Matplotlib +in different entries of ``sys.path``. Either uninstall Matplotlib from +at the system level or use a more isolated virtual environment. From fc00227b2856cf1fbc148f31fbf32bf32a96595b Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 24 Feb 2025 17:53:24 -0500 Subject: [PATCH 3/4] Update doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst Co-authored-by: Jody Klymak --- doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst b/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst index ccba751f975d..b6fbcca5735d 100644 --- a/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst +++ b/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst @@ -188,5 +188,5 @@ found for all other modules. This will result in errors due to the version miss-match. To avoid this issue you need to avoid having multiple versions of Matplotlib -in different entries of ``sys.path``. Either uninstall Matplotlib from +in different entries of ``sys.path``. Either uninstall Matplotlib at the system level or use a more isolated virtual environment. From 3f1b7f7acc49e5714eb9f8966a9b909b53e82259 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Fri, 2 May 2025 13:28:21 -0500 Subject: [PATCH 4/4] Spelling/grammar where as -> whereas miss-match -> mismatch Thanks to @Mecanerd for these suggestions Co-authored-by: Mecanerd --- doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst b/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst index b6fbcca5735d..8a21d5b4941e 100644 --- a/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst +++ b/doc/api/prev_api_changes/api_changes_3.8.0/behaviour.rst @@ -183,9 +183,9 @@ Following the deprecation of ``pkg_resources.declare_namespace`` in ``setuptools As a consequence using ``pip`` to install a version of Matplotlib >= 3.8 on top of a version of Matplotlib < 3.8 (e.g. via ``pip install --local`` or ``python -m venv --system-site-packages ...``) will fail because the old -``matplotlib.mpl_toolkits`` files will be found where as the newer files will be +``matplotlib.mpl_toolkits`` files will be found whereas the newer files will be found for all other modules. This will result in errors due to the version -miss-match. +mismatch. To avoid this issue you need to avoid having multiple versions of Matplotlib in different entries of ``sys.path``. Either uninstall Matplotlib