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
When attempting to import hydroDL.post.plot, the import fails with the following error: ImportError: cannot import name 'basemap' from 'mpl_toolkits' (unknown location)
Plot.py is mostly just definitions of plotting functions, but some basic packages are imported first. On line 16 of plot.py, we call from mpl_toolkits import basemap.
After some troubleshooting, I learned that mpl_toolkits and basemap in general is deprecated, and as of Matplotlib version 3.3 Basemap has been replaced by Cartopy.
This occurred when trying to plot in the Google Colab quick soil moisture tutorial, but I would expect similar issues when importing hydroDL.post.plot in other circumstances. The issue still occurs if attempting to only import a function from this script that does not use the basemap package, i.e. from hydroDL.post.plot import plotBoxFig
Actual error text below:
ImportError Traceback (most recent call last)
in <cell line: 1>()
----> 1 from hydroDL.post.plot import plotBoxFig
2 # plot boxplots for different experiments
3
4 statDictLst = [metrics_dict]
5
/content/hydroDLpack/hydroDL/post/plot.py in
14
15 os.environ['PROJ_LIB'] = r'/opt/anaconda/pkgs/proj4-5.2.0-he6710b0_1/share/proj/'
---> 16 from mpl_toolkits import basemap
17
18
ImportError: cannot import name 'basemap' from 'mpl_toolkits' (unknown location)
The text was updated successfully, but these errors were encountered:
When attempting to import hydroDL.post.plot, the import fails with the following error:
ImportError: cannot import name 'basemap' from 'mpl_toolkits' (unknown location)
Plot.py is mostly just definitions of plotting functions, but some basic packages are imported first. On line 16 of plot.py, we call
from mpl_toolkits import basemap
.After some troubleshooting, I learned that mpl_toolkits and basemap in general is deprecated, and as of Matplotlib version 3.3 Basemap has been replaced by Cartopy.
This occurred when trying to plot in the Google Colab quick soil moisture tutorial, but I would expect similar issues when importing hydroDL.post.plot in other circumstances. The issue still occurs if attempting to only import a function from this script that does not use the basemap package, i.e.
from hydroDL.post.plot import plotBoxFig
Actual error text below:
ImportError Traceback (most recent call last)
in <cell line: 1>()
----> 1 from hydroDL.post.plot import plotBoxFig
2 # plot boxplots for different experiments
3
4 statDictLst = [metrics_dict]
5
/content/hydroDLpack/hydroDL/post/plot.py in
14
15 os.environ['PROJ_LIB'] = r'/opt/anaconda/pkgs/proj4-5.2.0-he6710b0_1/share/proj/'
---> 16 from mpl_toolkits import basemap
17
18
ImportError: cannot import name 'basemap' from 'mpl_toolkits' (unknown location)
The text was updated successfully, but these errors were encountered: