I have run into a warning that only appears when the pyinstaller executable is run.
...appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:627: MatplotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3.
exec(bytecode, module.__dict__)
I have tried all of the suggestions here: Python/matplotlib : getting rid of matplotlib.mpl warning
I have also tried this without any change in the end result: Pyinstaller exe hide warning messages
without any change in the MatplotlibDeprecation warnings appearing in the final executable. The warnings are baseline not present when running the code in an IDE such as Pycharm.
Using: Python 3.7.2 Pyinstaller 3.5 Matplotlib 3.1.1
Find here the pyinstaller issue that (partly) addresses this problem.
The deprecation warning has been introduced for matplotlib >=3.1. Accordingly, the environment variable MATPLOTLIBDATA
will not be used anymore by pandas in future versions. However, PyInstaller currently relies on this variable for reasons not entirely clear to me.
The piece of code causing the warning is found in pyi_rth_mpldata.py:
os.environ["MATPLOTLIBDATA"] = os.path.join(sys._MEIPASS, "mpl-data")
Unfortunately, simply uncommenting the line locally (site-packages/PyInstaller/loader/rthooks/rpyi_rth_mpldata.py) is not an option, causing my PyInstaller bundles to crash.
I see currently the following options:
pip install 'matplotlib==3.0.3'
)matplotlib/__init__.py:625
)Option 1. was working for me, hopefully you are lucky as well. Options 2. and 3. are the easiest and should not have any side effects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With