Help on Py2exe with matplotlib

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chriskim
    New Member
    • Jul 2010
    • 5

    Help on Py2exe with matplotlib

    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\__i nit__.pyc", line 709, in <module>
    File "matplotlib\__i nit__.pyc", line 627, in rc_params
    File "matplotlib\__i nit__.pyc", line 569, in matplotlib_fnam e
    File "matplotlib\__i nit__.pyc", line 240, in wrapper
    File "matplotlib\__i nit__.pyc", line 483, in _get_data_path_ cached
    File "matplotlib\__i nit__.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\__i nit__.pyc", line 709, in <module>
    File "matplotlib\__i nit__.pyc", line 627, in rc_params
    File "matplotlib\__i nit__.pyc", line 569, in matplotlib_fnam e
    File "matplotlib\__i nit__.pyc", line 240, in wrapper
    File "matplotlib\__i nit__.pyc", line 483, in _get_data_path_ cached
    File "matplotlib\__i nit__.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
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    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:
    Code:
    set PIP=C:\Python\Lib\site-packages\pyinstaller-1.4\
    
    c:\Python\python %PIP%Makespec.py --onefile --noconsole --upx --ascii --tk --icon logo.ico source.py
    
    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.

    Comment

    Working...