473,466 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help on Py2exe with matplotlib

5 New Member
Hi I am having a very difficult time makine executable file using Py2exe. This program uses "matplotlib" to generate graphs and I think this is causing the errors

What extra codes are necessary to make this work??


Here is what error said...
Traceback (most recent call last):
File "real_test.py", line 7, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "matplotlib\__init__.pyc", line 709, in <module>
File "matplotlib\__init__.pyc", line 627, in rc_params
File "matplotlib\__init__.pyc", line 569, in matplotlib_fname
File "matplotlib\__init__.pyc", line 240, in wrapper
File "matplotlib\__init__.pyc", line 483, in _get_data_path_cached
File "matplotlib\__init__.pyc", line 479, in _get_data_path
RuntimeError: Could not find the matplotlib data files
Traceback (most recent call last):
File "real_test.py", line 7, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "matplotlib\__init__.pyc", line 709, in <module>
File "matplotlib\__init__.pyc", line 627, in rc_params
File "matplotlib\__init__.pyc", line 569, in matplotlib_fname
File "matplotlib\__init__.pyc", line 240, in wrapper
File "matplotlib\__init__.pyc", line 483, in _get_data_path_cached
File "matplotlib\__init__.pyc", line 479, in _get_data_path
RuntimeError: Could not find the matplotlib data files


I have attached my codes in text file.
Please help !!!
Attached Files
File Type: txt Emodels.txt (1.7 KB, 443 views)
File Type: txt real_test.txt (16.5 KB, 469 views)
File Type: txt setup.bat.txt (36 Bytes, 407 views)
File Type: txt setup.txt (216 Bytes, 470 views)
Jul 20 '10 #1
1 4038
bvdet
2,851 Recognized Expert Moderator Specialist
I attempted to create an executable file with Py2exe and failed also. However, I was able to with PyInstaller. There was a small bug in PyInstaller with respect to the Python version on my machine, but the problem was solved after I posted to the PyInstaller email discussion group. Give it a shot.

After installing PyInstaller, I created a subdirectory for my Python source code and a batch file to execute the commands. The batch file contents is something like this:
Expand|Select|Wrap|Line Numbers
  1. set PIP=C:\Python\Lib\site-packages\pyinstaller-1.4\
  2.  
  3. c:\Python\python %PIP%Makespec.py --onefile --noconsole --upx --ascii --tk --icon logo.ico source.py
  4.  
  5. c:\Python\python %PIP%Build.py source.spec
The executable file is created and placed in a subdirectory named "build". Check out the on-line documentation for more detailed information.
Jul 23 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Brad Clements | last post by:
Now that Thomas is back from vacation ;-) I cannot get the example service to work using Python 2.3 and the latest released py2exe (or the cvs version) on Win2k SP3. I can run the sample service...
2
by: Paul Mayal | last post by:
Hi, I have written a com server in python 2.3 (ActiveState distribution). I have build the dll with py2exe. First of all, py2exe complain he can't find pythoncom module. I can register the dll...
2
by: scott | last post by:
I am trying to convert a python app that uses matplotlib to a standalone executable using py2exe. After running py2exe and executing my app I get the following stack trace: Traceback (most...
2
by: Chris | last post by:
I've just completed a project using the following (Windows XP, python 2.4.1, wxpython 2.6, and pymssql 0.7.3). The program runs great, but after I convert it to an exe (required for this project),...
4
by: bwaha | last post by:
First time trying to create an executable with py2exe. I have a small program which makes use of python23 (2.3.5?), wxpython ('2.6.2.1'), matplotlib ('0.83.2'), win32com (latest?), Numeric...
2
by: Flavio | last post by:
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...
1
by: Srinivasa | last post by:
Hai friends, I wrote a programme to display a window (ui) using Python. I renamed it as .pyw to avoid popping-up the dos window while running it. It worked fine. But when i converted it to...
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.