I got the same error when I uninstall the texlive pakcage from CentOS using yum, and then install the latest texlive bundle manually from the website.
The cause of this error is due to the residual components from the previously installed texlive-* bundles. To this error, specifically, just find the 'luatex', which would be called by Matplotlib in "dviread.py" using '_LuatexKpsewhich() ', and fix it to the right version which is consistent to the texlive you're using.
For my case, just using the following cmd to fix the problem:
sudo mv /usr/bin/luatex /usr/bin/luatex.bk