Matplotlib is an important part of my deep learning workflows |

import matplotlib.pyplot as plt

import matplotlib # no errors import matplotlib.pyplot as plt # crash!!!

Try them in order and see which step works for you.

**1. **Check if multiple versions of numpy is installed, and remove any unnecessary versions if possible.

**2. **Try updating matplotlib

conda update matplotlib

**3. **Force reinstall matplotlib using conda

conda install -f matplotlib

**4. **Clean out any version of matplotlib which might have been installed using pip

conda remove matplotlib pip uninstall matplotlib conda install matplotlib

**5. **If all other steps fail, try removing the conda version of matplotlib, and installing using pip instead

conda remove matplotlib pip install matplotlib

Hopefully, these steps would help you get your matplotlib import working correctly again.

**Update:** As of January 2020, the error has been fixed in the latest version of Matplotlib (3.1.1).

Related links,

- https://stackoverflow.com/questions/28848270/import-matplotlib-pyplot-gives-importerror-dlopen-library-not-loaded-libpng1
- https://github.com/matplotlib/matplotlib/issues/10252/
- https://github.com/ContinuumIO/anaconda-issues/issues/1672
- https://stackoverflow.com/questions/24302091/error-when-import-matplotlib-pyplot-as-plt
- https://github.com/matplotlib/matplotlib/issues/10277
- https://github.com/ContinuumIO/anaconda-issues/issues/6689
- https://github.com/matplotlib/matplotlib/issues/4598/

**Build Deeper: The Path to Deep Learning**

Learn the bleeding edge of AI in the most practical way: By getting hands-on with Python, TensorFlow, Keras, and OpenCV. Go a little deeper…

## Leave a Reply Cancel reply