cx_freeze-ing

So, I have a working program that starts like this:

import os
import sys
import numpy as np
from pylab import *
from matplotlib.widgets import Slider
from matplotlib.patches import FancyBboxPatch, Rectangle

but when I cx_freeze it, it complains about some missing backend_ stuff, so,
I do:

import os
import sys
import numpy as np
*import matplotlib
matplotlib.use("TkAgg")
*from pylab import *
from matplotlib.widgets import Slider
from matplotlib.patches import FancyBboxPatch, Rectangle

but the problem continues...

...anybody know how to solve this problem?

I would appreciate very much.

Oh, here is the setup file generated with cx_freeze

from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = [], excludes = [])

import sys
base = 'Win32GUI' if sys.platform=='win32' else None

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

setup(name='Cross-slot-flux',
      version = '1.0',
      description = 'Visual',
      options = dict(build_exe = buildOptions),
      executables = executables)

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/cx-freeze-ing-tp41780.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

oh, I got it...needed to include backend package in the cf_freeze setup
script.

thanks,

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/cx-freeze-ing-tp41780p41782.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Hi gsal,

Would you mind sharing a simple example how did you manage to that? I am
trying to freeze a simple code with matplotlib for the past two days with no
success, every time I get the "No module backend_tkagg" message... ;(

Many thanks for help in advance!

gsal wrote

···

oh, I got it...needed to include backend package in the cf_freeze setup
script.

thanks,

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/cx-freeze-ing-tp41780p41808.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I fixed this problem by including the following line in my source code file:

from matplotlib.backends import backend_tkagg

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/cx-freeze-ing-tp41780p45639.html
Sent from the matplotlib - users mailing list archive at Nabble.com.