In my code I am using:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
When I build the .py script, everything works fine. But after using the pyinstaller.exe to get the executable file, I get following error:
Traceback (most recent call last):
File "C:\Program Files\Python38\Scripts\excel_to_python.py", line 10, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "c:\program files\Python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "matplotlib\__init__.py", line 913, in <module>
File "matplotlib\__init__.py", line 812, in _rc_params_in_file
File "contextlib.py", line 113, in __enter__
File "matplotlib\__init__.py", line 790, in _open_file_or_url
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\usr\\AppData\\Local\\Temp\\_MEI640402\\matplotlib\\mpl-data\\matplotlibrc'
[62044] Failed to execute script mpl_script
I tried to reinstall the matplotlib and pyinstaller but it is all the same.