Matplotlib deprecation warning in local jupyter environment

Hi community,

I’m making my way through the Data Scientist in Python path, and I’m on the Visualizing Geographical Data mission. My code works fine in the DQ virtual machine, but when I try to run it locally in a Jupyter Notebook I get a deprecation warning. The warning doesn’t clearly tell me how to resolve the issue; can you help?

My code:

import pandas as pd
import matplotlib.pyplot as plt
# from pandas.plotting import register_matplotlib_converters
# register_matplotlib_converters()
from mpl_toolkits.basemap import Basemap
m = Basemap(projection='merc',llcrnrlat=-80,urcrnrlat=80,llcrnrlon=-180,urcrnrlon=180)

The warning when running the code:

/Users/Tom/miniconda2/lib/python3.7/site-packages/ MatplotlibDeprecationWarning: 
The dedent function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use inspect.cleandoc instead.

Attempted resolution:

In a previous mission introducing Matplotlib, I got a similar warning that was more clear on how to resolve the issue, which was to add the following 2 lines of code:

from pandas.plotting import register_matplotlib_converters

Is there a similar bit of code I need to add for basemap to function in my local environment?

1 Like

Hi @tlsmart1,

Try updating Basemap module as this link suggests that it has been fixed:


Thanks for the suggestion @Sahil. My versions seem to be up to date, and conda update matplotlib didn’t change anything. I also tried conda update basemap, but nothing there either. Maybe I should be using a different version of Python?

I’ll just continue on I guess, and ignore the warning for now.

Hi @tlsmart1,

The fix has been implemented on Basemap version 1.2.1 and the latest Basemap in Anaconda repository is 1.2.0. Therefore, either you can ignore the warning for now or install 1.2.1 from conda-forge:

conda install -c conda-forge basemap


Hi Sahil

I am having same problem please advise?

I tried all above but to no avail.

1 Like

Hi @jamesberentsen,

Can you please let me know the basemap version in your Anaconda environment? Also, I would like to point out that Deprecation warnings are just warnings for something that will happen in the future, it won’t have any impact on the result of your code.


Hi Sahil,

I ran this
python --version
to find my python version is
Python 3.7.4

conda search basemap --info
name : basemap
version : 1.3.0


1 Like

Hi @jamesberentsen

Yes, I am able to reproduce this issue in version 1.3.0. But when I downgraded it to version 1.2.1 the issue was solved.

Please run this command to downgrade Basemap to version 1.2.1:
conda install -c conda-forge basemap=1.2.1


1 Like

Thanks I’ll try that

1 Like