{{ message }}
Try/except import of Axes3D - #27178
Merged
Merged
Conversation
On some installs, the `mpl_toolkits` namespace package gets an old version which uses deprecated (And removed) code from the main library. On such the import of Axes3D will error with an `ImportError`. This prevents users from using any of `matplotlib`, since it is imported unconditionally by default. This just try/excepts the imports (and adjusts the registration code accordingly) to allow users to continue using matplotlib (though not 3D and possibly not other mpl_toolkits) even with older installs occluding the mpl_toolkits.
Member
Author
Member
|
I think we should warn. I'm inclined to let people know that their installations are messed up (or I may just be cranky today after two h5py issues that boiled down to "broken installation"). |
Member
Author
tacaswell
approved these changes
Oct 25, 2023
QuLogic
reviewed
Oct 25, 2023
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
QuLogic
approved these changes
Oct 25, 2023
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Oct 26, 2023
timhoffm
added a commit
that referenced
this pull request
Oct 26, 2023
…178-on-v3.8.x Backport PR #27178 on branch v3.8.x (Try/except import of Axes3D)
This was referenced Nov 2, 2023
Merged
ksunden
added a commit
to ksunden/matplotlib
that referenced
this pull request
Nov 8, 2023
Needed for the same reasons as matplotlib#27178 (Namely that we should not be failing on import just because mpl_toolkits is broken), but mpl 3.6 presents with an AttributeError rather than ImportError See discussion in matplotlib#26827 and matplotlib#27289 Just expanded liberally in case there are other presentations we have not seen
ksunden
added a commit
to ksunden/matplotlib
that referenced
this pull request
Nov 8, 2023
Needed for the same reasons as matplotlib#27178 (Namely that we should not be failing on import just because mpl_toolkits is broken), but mpl 3.6 presents with an AttributeError rather than ImportError See discussion in matplotlib#26827 and matplotlib#27289 Just expanded liberally in case there are other presentations we have not seen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR summary
On some installs, the
mpl_toolkitsnamespace package gets an oldversion which uses deprecated (And removed) code from the main library.
On such the import of Axes3D will error with an
ImportError.This prevents users from using any of
matplotlib, since it is importedunconditionally by default.
This just try/excepts the imports (and adjusts the registration code
accordingly) to allow users to continue using matplotlib (though not 3D
and possibly not other mpl_toolkits) even with older installs occluding
the mpl_toolkits.
Addresses at least the most pressing part of #26827
(Not quite sure we want to close that or not)
PR checklist