You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If cartopy is installed without optional dependencies, it would be nice to have a helpful error message when trying to use functions that depend on such libraries. Currently, just an ImportError is raised. It would be more useful to notify the user of the optional dependency (possibly including a documentation link).
It's nice that cartopy has less dependencies. But it may be surprising to many users that cartopy can no longer plot any plots in the default conda installation (at least matplotlib and scipy seem to be required, which are no longer installed per default).
I'd be happy to work on this. I'm guessing a try-except around the import would fix this.
Should only the files inside lib/cartopy/* be modified with the helpful error message (no docs/ nor examples/) ?
Maybe also the lib/cartopy/tests should not be touched since only developers use it.
An idea, would it be correct to add import matplotlib and a try-except around it in lib/cartopy/mpl/__init__.py since clearly matplotlib is used everywhere in that package ?
Description
If cartopy is installed without optional dependencies, it would be nice to have a helpful error message when trying to use functions that depend on such libraries. Currently, just an ImportError is raised. It would be more useful to notify the user of the optional dependency (possibly including a documentation link).
Code to reproduce
Traceback
Full environment definition
Operating system
Linux-64
Cartopy version
cartopy 0.18.0 py38h88488af_4 conda-forge
conda list
The text was updated successfully, but these errors were encountered: