Using Cx_freeze to convert a tkinter exe containing seaborn library is causing error

Viewed 31

I'm a newbie. Getting the following error when using cx_Freeze with seaborn. Below is the code minimum example: I am using the "python setup.py bdist_msi" to run it.

I have tried uninstalling and re-installing seaborn, But it didn't work. Please help.

enter image description here

[1]: https://i.stack.imgur.com/tmOFQ.png

import tkinter as tk

from tkinter import  Label, Button
import numpy as np

import seaborn as sns 
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,NavigationToolbar2Tk)

def create_plot(): 
    data = np.random.rand(50,11)
    g = sns.clustermap(data,cmap='YlGnBu',metric = 'correlation',z_score=0) 
    return g.fig



root = tk.Tk()
root.wm_title("Tk Window")

label = tk.Label(root, text="Seaborn Clustermap Plot")
label.pack()

fig = create_plot()

canvas = FigureCanvasTkAgg(fig, master=root) 
canvas.draw()
canvas.get_tk_widget().pack()

tk.mainloop()

And this is the setup file:

import cx_Freeze
import sys
import os
import platform

base=None # hide cmd window

if sys.platform == "win32":
        base = "Win32GUI"

build_exe_options = { 
                           "include_files":[],  
                           "packages":[],                               
                         }


executables = [cx_Freeze.Executable('sns1.py', base=base)]

cx_Freeze.setup(
     name="ABC",
     options = {"build_exe":build_exe_options},
     version = '0.1',
     description = "SNS Example",
     executables = executables
     )

0 Answers
Related