Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find the matplotlib data files

I am new to python and I am trying to create an .exe from py script with pyinstaller but I get this error when trying to run the .exe: Could not find the matplotlib data files. When i run the script in python idle i dont get this error.

I've tried:

 import matplotlib
   setup(
        data_files=matplotlib.get_py2exe_datafiles(),
   )

But i get an error saying that setup is not defined.

like image 424
Mihai Plesa Avatar asked Jul 26 '20 16:07

Mihai Plesa


2 Answers

I've fixed the problem by downgrading matplotlib to version 3.0.3 Using this command: python -m pip install matplotlib==3.0.3

like image 68
Mihai Plesa Avatar answered Oct 05 '22 03:10

Mihai Plesa


The only thing that worked "sustainably" for me is to also downgrade to and earlier version of Matplotlib version 3.1.3. I can now use pyinstaller. I can also run all program without that horrible warnings and stuff that it gives.

I used pip install matplotlib==3.1.3. make sure you uninstall all previous matplotlib.

like image 24
apemanx Avatar answered Oct 05 '22 03:10

apemanx