We have used python matplotlib library to write a python example, however, we encounter an ImportError: cannot import name ‘_path’. In this tutorial, we will introduce how to fix this error.
Why this import error occur?
Look at error message below:
We will find: we have installed python matplotlib, however, this error is reported in path.py.
As to us, this version of python matplotlib is installed in python 3.5, however, the current python version is python 3.6, we have updated python version. So this error occurs.
How to fix matplotlib import error?
The most easiest way is install python matplotlib in python 3.6 again. You can read this tutorial to install matplotlib with anaconda.
We install it again, then this import error is fixed.