473,406 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

cx_freeze and matplotlib


I am trying to freeze an application which imports matplotlib. It all
works fine on the machine where it was frozen. The executable runs
without a glitch.

But when I move the directory containing the frozen executable and
other libs to a new machine, I get the following error:

Traceback (most recent call last):
File
"/home/fccoelho/Downloads/cx_Freeze-3.0.2/initscripts/Console.py",
line 26, in ?
File "epigrass.py", line 5, in ?
File "Epigrass/manager.py", line 7, in ?
File "Epigrass/simobj.py", line 4, in ?
File "/usr/lib/python2.4/site-packages/matplotlib/__init__.py", line
457, in ?
try: return float(s)
File "/usr/lib/python2.4/site-packages/matplotlib/__init__.py", line
245, in wrapper
if level not in self.levels:
File "/usr/lib/python2.4/site-packages/matplotlib/__init__.py", line
319, in _get_data_path
Return the string representing the configuration dir. If s is the
RuntimeError: Could not find the matplotlib data files

Matplotlib can't find its data files.
Apparently this problem comes up in py2exe as well and it is handled
like this:

from distutils.core import setup
import glob
import py2exe

data = glob.glob(r'C:\Python23\share\matplotlib\*')
data.append(r'C:\Python23\share\matplotlib\matplot librc')

setup( console = ["simple_plot.py"],
data_files = [("matplotlibdata", data)],
)

This is the only thing I need to solve before I can distribute my
frozen package, so please help me here. There must be a way since the
frozen works in the original machine but not on the new Which also has
the same version of matplotib installed.

May 13 '06 #1
2 4824
Flavio wrote:
I am trying to freeze an application which imports matplotlib. It all
works fine on the machine where it was frozen. The executable runs
without a glitch.

But when I move the directory containing the frozen executable and
other libs to a new machine, I get the following error:

Traceback (most recent call last):
File
"/home/fccoelho/Downloads/cx_Freeze-3.0.2/initscripts/Console.py",
line 26, in ?
File "epigrass.py", line 5, in ?
File "Epigrass/manager.py", line 7, in ?
File "Epigrass/simobj.py", line 4, in ?
File "/usr/lib/python2.4/site-packages/matplotlib/__init__.py", line
457, in ?
try: return float(s)
File "/usr/lib/python2.4/site-packages/matplotlib/__init__.py", line
245, in wrapper
if level not in self.levels:
File "/usr/lib/python2.4/site-packages/matplotlib/__init__.py", line
319, in _get_data_path
Return the string representing the configuration dir. If s is the
RuntimeError: Could not find the matplotlib data files

Matplotlib can't find its data files.


I'm not familiar with cx_freeze, but have you told cx_freeze that you
don't want to bundle matplotlib or cx_freeze has decided that
matplotlib is not going to be bundled? That fact that matplotlib is
loaded from site-package is pretty strange, standalone application are
not supposed to depend on non-system packages.

May 14 '06 #2
My application needs needs matplotlib. So cx_Freeze bundles it in. But
it only bundles matplotlib python modules, not its data files!

In the original machine I believe that the frozen executable is somehow
finding those datafiles in their original locations, which is not
desirable, ecause the bundle should be completely independent of
external files.

May 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Hunter | last post by:
matplotlib is a 2D plotting library for python. You can use matplotlib interactively from a python shell or IDE, or embed it in GUI applications (WX, GTK, and Tkinter). matplotlib supports many...
7
by: Flavio | last post by:
Hi, After a good deal of tunig I managed to freeze my application. I ended up with an executable, and a Bunch of .so files in the install-dir. It runs fine in the original machine. I...
2
by: Grant Edwards | last post by:
I downloaded examples/contour_demo.py, and it doesn't run. I've searched both the user guide and the Wiki for "contour" and got zero hits. ...
1
by: Kevin Walzer | last post by:
I am trying to build a simple "hello.py" script with cx_freeze, but am not having any luck. Every time I run the FreezePython utility I get this error message: Traceback (most recent call last):...
0
by: spross | last post by:
hi all i have to use matplotlib on mac os x. on the official site of matplotlib, i found a link to precompiled python packages for mac os x: http://pythonmac.org/packages/py24-fat/index.html ...
1
by: mathieu | last post by:
Hello, I am currently investigating how to distribute a python based application on a targeted linux system (debian) and so far I only found two options: - Freeze (shipped with python dist) -...
3
by: vajratkarviraj | last post by:
i hav python2.5, matplotlib0.90.1, and py2exe for python 2.5 all on windows xp... i hav a python program(letsc.py) which uses the matplotlib package... and i want 2 make an exe of it for distribution...
4
by: John Henry | last post by:
Has anybody been able to create an exe of their python applications involving matplotlib using pyinstall (ver 1.3)? I am getting a: RuntimeError: Could not find the matplotlib data files when...
0
by: PamMish1982 | last post by:
Hi all, I have recently started using Python and I am trying to make a GUI out of Tkinter. I am using matplotlib for the graphic purposes. I have to make a exe file from this code. I use py2exe...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.