473,602 Members | 2,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.p y", 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\shar e\matplotlib\ma tplotlibrc')

setup( console = ["simple_plot.py "],
data_files = [("matplotlibdat a", 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 4847
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.p y", 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
2606
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 plot types: line plots, bar charts, log plots, images, pseudocolor plots, legends, date plots, finance charts and more. What's new since matplotlib 0.50 This is the first wide release in 5 months and there has been a tremendous amount of...
7
3333
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 copied the install folder to another machine but the executable wont run. Here's the traceback:
2
11642
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. http://matplotlib.sourceforge.net/matplotlib.pylab.html#-contour appears to be a good reference if you already know how to use contour(), but I could glean zero clues from it on how to actually use contour(). For example, it doesn't explain what the actual formats/types of the parameters. It...
1
4345
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): File "/Users/kevin/Desktop/cx_Freeze-3.0.2/initscripts/ConsoleKeepPath.py", line 15, in ? exec code in m.__dict__ File "FreezePython.py", line 1, in ?
0
2586
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 so first, i installed python 2.4. that works great! if i type 'python' in the terminal, it loads python 2.4. after that, i loaded and installed the matplotlib package from this
1
3079
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) - cx_Freeze (*) As far as I understand those two options are very close. According to the cx_Freeze README cx_Freeze is simply easier to use (no dependencie
3
4707
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 on other comps... i used py2exe... i wrote a setup.py whose contents are : from distutils.core import setup import py2exe import matplotlib setup(console=, options={ 'py2exe': { 'packages' : ,
4
9667
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 I attempt to run the exe created. In searching the web, it appears this is an issue when others tried to use py2exe as well. Unfortunately, the few hits I saw doesn't include enough details to inspire me as to what I should be doing in my
0
4325
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 for this purpose but every time I try to make this exe using a setup file I get these errors. Final.py is my python code. Traceback (most recent call last): File "Final.py", line 5, in <module> File "pylab.pyc", line 1, in <module> File...
0
7993
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7921
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8404
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8056
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5870
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1511
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.