Matplotlib import error with d2l package

I got the same error. solution steps:

  1. anaconda pip uninstall matplotlib
  2. in the command pip uninstall matplotlib
    then go to files and delete matplotlib all files and ~atplotlib.libs files.
  3. dowload d2l files and change the remove the read-only in the properties of the folder.
  4. pip install matplotlib and pip install d2l