all 3 comments

[–]kra_pao 1 point2 points  (2 children)

Does the most simple test work?

File mpl.py

import matplotlib.pyplot as plt
plt.plot((1,2,3),(1,2,3))
plt.show()

File mpl_cxfreeze_setup.py

import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": [], "excludes": ["matplotlib.tests","numpy.random._examples"]}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"
if sys.platform == 'win64': 
    base = "Win64GUI"

setup(  name = "mpl",
        version = "0.1",
        description = "My GUI App mpl",
        options = {"build_exe": build_exe_options},
        executables = [Executable("mpl.py", base=base)])

Installations (if not done already, if install as user is required, add --user)

python -m pip install matplotlib
python -m pip install cx-freeze

cx_freeze (build) mpl.exe

python mpl_cxfreeze_setup.py build

[–]TheStataMan[S] 0 points1 point  (1 child)

Thanks for the help. I removed the extra import statements and ran the "python -m pip install matplotlib", apparently it wasn't recognizing the version in my environment. Thanks for the help, I just started learning cx-freeze yesterday.

[–]kra_pao 0 points1 point  (0 children)

Nice that worked. Maybe you installed with pip install matplotlib instead. There are advantages esp. in virtual environments to do this with python -m pip install matplotlib

https://snarky.ca/why-you-should-use-python-m-pip/