matplotlib and py2exe

Hi all,

I have a python application that uses matplotlib. I want to compile it into an executable. I tried using py2exe but it returned some error w.rt matplotlib. Cpuld anyone please help me with this? Is there some other way to get it done?

Thanks,
Archana

Hi Archana,

Archana Ganesan wrote:

Hi all,

I have a python application that uses matplotlib. I want to compile it into an executable. I tried using py2exe but it returned some error w.rt matplotlib. Cpuld anyone please help me with this? Is there some other way to get it done?

I am using matplotlib (currently 0.90) with wxPython and py2exe
(0.6.6). Attached are some sample files.

I am on:
# Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
# wxPython 2.8.1.1, Boa Constructor 0.5.2

And as I am still using wxPython Ansi I renamed

matplotlib/backends/_wxagg.pyd

to

matplotlib/backends/_wxagg not used.pyd

Hope this helps
Werner

setup.py (4.19 KB)

embedding_in_wx4.py (3.71 KB)

Hi all,
I have a python application that uses matplotlib.I am trying to compile it into an executable using py2exe. I am encountering “No module named num_array problem”. I do not know
how to resolve this. I notice that “matplotlib.numerix” is in the
included package. Did you encounter this problem. I am very new to this
and I have to get it done by tomm. So I am sorry if it is really silly.

Thanks,

Archana.

···

On 3/31/07, Archana Ganesan < archana.ganesan@…287…> wrote:

Hi all,

I have a python application that uses matplotlib. I want to compile it into an executable. I tried using py2exe but it returned some error w.rt matplotlib. Cpuld anyone please help me with this? Is there some other way to get it done?

Thanks,
Archana

It is hard to guess what exactly your problem is as you do not provide a code

example or the traceback call of your exception. I would venture that you are

trying to create a num_array without having Numerix, numpy or numarray imported

or installed on your machine.

Some more information about your troubles would be needed to really help you out.

Cheers

Tommy

···

On Mar 31, 2007, at 3:50 PM, Archana Ganesan wrote:

Hi all,
I have a python application that uses matplotlib.I am trying to compile it into an executable using py2exe. I am encountering “No module named num_array problem”. I do not know how to resolve this. I notice that “matplotlib.numerix” is in the included package. Did you encounter this problem. I am very new to this and I have to get it done by tomm. So I am sorry if it is really silly.

Thanks,

Archana.

On 3/31/07, Archana Ganesan < archana.ganesan@…287…> wrote:

Hi all,

I have a python application that uses matplotlib. I want to compile it into an executable. I tried using py2exe but it returned some error w.rt matplotlib. Cpuld anyone please help me with this? Is there some other way to get it done?

Thanks,
Archana


Take Surveys. Earn Cash. Influence the Future of IT

Join SourceForge.net’s Techsay panel and you’ll get the chance to share your

opinions on IT & business topics through brief surveys-and earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi all,

The exception I get is
Traceback (most recent call last):
File “App1.py”, line 6, in ?
File “Frame1.pyc”, line 9, in ?
File “Simulation.pyc”, line 16, in ?
File “pylab.pyc”, line 1, in ?
File “matplotlib\pylab.pyc”, line 199, in ?
File “matplotlib\cm.pyc”, line 5, in ?
File “matplotlib\colors.pyc”, line 33, in ?
File “matplotlib\numerix_init_.pyc”, line 147, in ?

ImportError: No module named random_array

I have numpy installed in site-packages. The setup.py that I am using is as follows:

Thanks,
Archana.

from distutils.core import setup
import os

from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

cleanup dist and build directory first (for new py2exe version)

if os.path.exists(“dist/prog”):
shutil.rmtree(“dist/prog”)

if os.path.exists(“dist/lib”):
shutil.rmtree
(“dist/lib”)

if os.path.exists(“build”):
shutil.rmtree(“build”)

options = {“py2exe”: {“compressed”: 1,
“optimize”: 2,

                 "packages": ["encodings",

“kinterbasdb”,

                              "pytz.zoneinfo.UTC",
                              #"

matplotlib.numerix",

“email”,

                                ##"numpy"

“PIL”,

                              ],
                 "excludes": ["MySQLdb", "Tkconstants", "Tkinter", "tcl",
                              "orm.adapters.pgsql

“, “orm.adapters.mysql”
],
“dll_excludes”: [“tcl84.dll”, “tk84.dll”, “wxmsw26uh_vc.dll”]
}
}
zipfile = r"lib\library.zip”

setup(
classifiers = [“Copyright:: your name”,
“Development Status :: 5 Stable”,
“Intended Audience :: End User”,

                "License :: Shareware",
                "Operating System :: Microsoft :: Windows 2000",
                "Operating System :: Microsoft :: Windows XP",
                "Operating System :: Microsoft :: Windows 9x",
                "Programming Language :: Python, wxPython",
                "Topic :: Home Use"
                "Natural Language :: German",

                "Natural Language :: French",
                "Natural Language :: English"],

windows = [wx_emb],

 #console = [twcb],
 options = options,
 zipfile = zipfile,

 data_files = [("lib\\matplotlibdata", mpfiles),
                matplotlib.get_py2exe_datafiles() # if you don't use the lib option

(“prog\amaradata”, amaradata),

(“prog\amaradata\Schemata”, amaraschemata),

(“prog\”, python4dll)

               ]

)

···

On 3/31/07, Tommy Grav <tgrav@…935…> wrote:

It is hard to guess what exactly your problem is as you do not provide a code

example or the traceback call of your exception. I would venture that you are

trying to create a num_array without having Numerix, numpy or numarray imported

or installed on your machine.

Some more information about your troubles would be needed to really help you out.

Cheers

Tommy

On Mar 31, 2007, at 3:50 PM, Archana Ganesan wrote:

Hi all,
I have a python application that uses matplotlib.I am trying to compile it into an executable using py2exe. I am encountering “No module named num_array problem”. I do not know how to resolve this. I notice that "
matplotlib.numerix" is in the included package. Did you encounter this problem. I am very new to this and I have to get it done by tomm. So I am sorry if it is really silly.

Thanks,

Archana.

On 3/31/07, Archana Ganesan < archana.ganesan@…287… > > > wrote:

Hi all,

I have a python application that uses matplotlib. I want to compile it into an executable. I tried using py2exe but it returned some error w.rt matplotlib. Cpuld anyone please help me with this? Is there some other way to get it done?

Thanks,
Archana


Take Surveys. Earn Cash. Influence the Future of IT

Join SourceForge.net’s Techsay panel and you’ll get the chance to share your

opinions on IT & business topics through brief surveys-and earn cash


http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net


https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Take Surveys. Earn Cash. Influence the Future of IT

Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I do not immediately see why the error occurs. Hopefully someone else

can add their input. Off the cuff it seems like matplotlib has not been

installed properly. Can you confirm that import numpy and import

matplotlib works in the interactive python shell.

Cheers

Tommy

[tgrav@…1542…] /Users/tgrav --> python

Python 2.4.4 (#1, Oct 18 2006, 10:34:39)

[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin

Type “help”, “copyright”, “credits” or “license” for more information.

import numpy

import matplotlib

from matplotlib.numerix import *

random_array

<module ‘matplotlib.numerix.random_array’ from ‘/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/numerix/random_array/init.pyc’>

numpy.version

‘1.0.1.dev3436’

matplotlib.version

‘0.87.7’

so random_array works fine in my version

···

On Mar 31, 2007, at 4:26 PM, Archana Ganesan wrote:

Hi all,

The exception I get is
Traceback (most recent call last):
File “App1.py”, line 6, in ?
File “Frame1.pyc”, line 9, in ?
File “Simulation.pyc”, line 16, in ?
File “pylab.pyc”, line 1, in ?
File “matplotlib\pylab.pyc”, line 199, in ?
File “matplotlib\cm.pyc”, line 5, in ?
File “matplotlib\colors.pyc”, line 33, in ?
File “matplotlib\numerix_init_.pyc”, line 147, in ?
ImportError: No module named random_array

I have numpy installed in site-packages. The setup.py that I am using is as follows:

Thanks,
Archana.

from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

cleanup dist and build directory first (for new py2exe version)

if os.path.exists(“dist/prog”):
shutil.rmtree(“dist/prog”)

if os.path.exists(“dist/lib”):
shutil.rmtree (“dist/lib”)

if os.path.exists(“build”):
shutil.rmtree(“build”)

options = {“py2exe”: {“compressed”: 1,
“optimize”: 2,
“packages”: [“encodings”,

“kinterbasdb”,

                              "pytz.zoneinfo.UTC",
                              #" matplotlib.numerix",

“email”,

                                ##"numpy"

“PIL”,

                              ],
                 "excludes": ["MySQLdb", "Tkconstants", "Tkinter", "tcl",
                              "orm.adapters.pgsql ", "orm.adapters.mysql"
                 ],
                 "dll_excludes": ["tcl84.dll", "tk84.dll", "wxmsw26uh_vc.dll"]
                 }
      }

zipfile = r"lib\library.zip"

setup(
classifiers = [“Copyright:: your name”,
“Development Status :: 5 Stable”,
“Intended Audience :: End User”,
“License :: Shareware”,
“Operating System :: Microsoft :: Windows 2000”,
“Operating System :: Microsoft :: Windows XP”,
“Operating System :: Microsoft :: Windows 9x”,
“Programming Language :: Python, wxPython”,
“Topic :: Home Use”
“Natural Language :: German”,
“Natural Language :: French”,
“Natural Language :: English”],

windows = [wx_emb],

 #console = [twcb],
 options = options,
 zipfile = zipfile,
 data_files = [("lib\\matplotlibdata", mpfiles),
                matplotlib.get_py2exe_datafiles() # if you don't use the lib option

(“prog\amaradata”, amaradata),

(“prog\amaradata\Schemata”, amaraschemata),

(“prog\”, python4dll)

               ]

)

On 3/31/07, Tommy Grav <tgrav@…935…> wrote:

It is hard to guess what exactly your problem is as you do not provide a code

example or the traceback call of your exception. I would venture that you are

trying to create a num_array without having Numerix, numpy or numarray imported

or installed on your machine.

Some more information about your troubles would be needed to really help you out.

Cheers

Tommy

On Mar 31, 2007, at 3:50 PM, Archana Ganesan wrote:

Hi all,
I have a python application that uses matplotlib.I am trying to compile it into an executable using py2exe. I am encountering “No module named num_array problem”. I do not know how to resolve this. I notice that " matplotlib.numerix" is in the included package. Did you encounter this problem. I am very new to this and I have to get it done by tomm. So I am sorry if it is really silly.

Thanks,

Archana.

On 3/31/07, Archana Ganesan < archana.ganesan@…287… > wrote:

Hi all,

I have a python application that uses matplotlib. I want to compile it into an executable. I tried using py2exe but it returned some error w.rt matplotlib. Cpuld anyone please help me with this? Is there some other way to get it done?

Thanks,
Archana


Take Surveys. Earn Cash. Influence the Future of IT

Join SourceForge.net’s Techsay panel and you’ll get the chance to share your

opinions on IT & business topics through brief surveys-and earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Matplotlib-users mailing list
Matplotlib-users@…1543…rge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

import numpy and import matplotlib does work in the interactive python shell.

thanks,
Archana.

···

On 3/31/07, Tommy Grav < tgrav@…935…> wrote:

I do not immediately see why the error occurs. Hopefully someone else

can add their input. Off the cuff it seems like matplotlib has not been

installed properly. Can you confirm that import numpy and import

matplotlib works in the interactive python shell.

Cheers

Tommy

[tgrav@…1542…] /Users/tgrav --> python

Python 2.4.4 (#1, Oct 18 2006, 10:34:39)

[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin

Type “help”, “copyright”, “credits” or “license” for more information.

import numpy

import matplotlib

from matplotlib.numerix import *

random_array

<module ‘matplotlib.numerix.random_array’ from ‘/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/numerix/random_array/init.pyc’>

numpy.version

‘1.0.1.dev3436’

matplotlib.version

‘0.87.7’

so random_array works fine in my version

On Mar 31, 2007, at 4:26 PM, Archana Ganesan wrote:

Hi all,

The exception I get is
Traceback (most recent call last):

File “App1.py”, line 6, in ?
File “Frame1.pyc”, line 9, in ?
File “Simulation.pyc”, line 16, in ?
File “pylab.pyc”, line 1, in ?
File “matplotlib\pylab.pyc”, line 199, in ?

File “matplotlib\cm.pyc”, line 5, in ?
File “matplotlib\colors.pyc”, line 33, in ?
File “matplotlib\numerix_init_.pyc”, line 147, in ?
ImportError: No module named random_array

I have numpy installed in site-packages. The setup.py that I am using is as follows:

Thanks,
Archana.

from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

cleanup dist and build directory first (for new py2exe version)

if os.path.exists(“dist/prog”):
shutil.rmtree(“dist/prog”)

if os.path.exists(“dist/lib”):
shutil.rmtree (“dist/lib”)

if os.path.exists(“build”):

shutil.rmtree(“build”)

options = {“py2exe”: {“compressed”: 1,
“optimize”: 2,
“packages”: [“encodings”,

“kinterbasdb”,

                              "pytz.zoneinfo.UTC",
                              #" matplotlib.numerix",

“email”,

                                ##"numpy"

“PIL”,

                              ],
                 "excludes": ["MySQLdb", "Tkconstants", "Tkinter", "tcl",

                              "orm.adapters.pgsql ", "orm.adapters.mysql"
                 ],
                 "dll_excludes": ["tcl84.dll", "tk84.dll", "wxmsw26uh_vc.dll"]

                 }
      }

zipfile = r"lib\library.zip"

setup(
classifiers = [“Copyright:: your name”,
“Development Status :: 5 Stable”,

                "Intended Audience :: End User",
                "License :: Shareware",
                "Operating System :: Microsoft :: Windows 2000",
                "Operating System :: Microsoft :: Windows XP",

                 "Operating System :: Microsoft :: Windows 9x",
                "Programming Language :: Python, wxPython",
                "Topic :: Home Use"
                "Natural Language :: German",
                "Natural Language :: French",
                "Natural Language :: English"],

windows = [wx_emb],

 #console = [twcb],
 options = options,
 zipfile = zipfile,
 data_files = [("lib\\matplotlibdata", mpfiles),
                matplotlib.get_py2exe_datafiles() # if you don't use the lib option

(“prog\amaradata”, amaradata),

(“prog\amaradata\Schemata”, amaraschemata),

(“prog\”, python4dll)

               ]

)

On 3/31/07, Tommy Grav <tgrav@…935…> wrote:

It is hard to guess what exactly your problem is as you do not provide a code

example or the traceback call of your exception. I would venture that you are

trying to create a num_array without having Numerix, numpy or numarray imported

or installed on your machine.

Some more information about your troubles would be needed to really help you out.

Cheers

Tommy

On Mar 31, 2007, at 3:50 PM, Archana Ganesan wrote:

On 3/31/07, Archana Ganesan < archana.ganesan@…287… > wrote:

Hi all,

I have a python application that uses matplotlib. I want to compile it into an executable. I tried using py2exe but it returned some error w.rt matplotlib. Cpuld anyone please help me with this? Is there some other way to get it done?

Thanks,
Archana


Take Surveys. Earn Cash. Influence the Future of IT

Join SourceForge.net’s Techsay panel and you’ll get the chance to share your

opinions on IT & business topics through brief surveys-and earn cash


http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net


https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi all,
I have a python application that uses matplotlib.I am trying to compile it into an executable using py2exe. I am encountering “No module named num_array problem”. I do not know how to resolve this. I notice that " matplotlib.numerix" is in the included package. Did you encounter this problem. I am very new to this and I have to get it done by tomm. So I am sorry if it is really silly.

Thanks,

Archana.


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net
's Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Archana Ganesan wrote:

Hi all,

The exception I get is
Traceback (most recent call last):
  File "App1.py", line 6, in ?
  File "Frame1.pyc", line 9, in ?
  File "Simulation.pyc", line 16, in ?
  File "pylab.pyc", line 1, in ?
  File "matplotlib\pylab.pyc", line 199, in ?
  File "matplotlib\cm.pyc", line 5, in ?
  File "matplotlib\colors.pyc", line 33, in ?
  File "matplotlib\numerix\__init__.pyc", line 147, in ?
ImportError: No module named random_array

Did you follow these instructions?

  http://www.py2exe.org/index.cgi/MatPlotLib

···

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
  -- Umberto Eco

Hi Archana,

Sometimes py2exe can't figure out what needs to be included. In these cases one creates entries in the packages section to force the inclusion of one or multiple packages.

Archana Ganesan wrote:

Hi all,
...

options = {"py2exe": {"compressed": 1,
                     "optimize": 2,
                     "packages": ["encodings",
## "kinterbasdb",
                                  "pytz.zoneinfo.UTC",
                                  #" matplotlib.numerix",
  
You need to activate/un-comment the matplotlib.numerix line. Also note that if you only include UTC and you use the timezone stuff in matplot then a user NOT using UTC, i.e. another timezone will have a problem, it is therefore better to just include all of pytz.

Werner

Hi,

I tried following the instructions at the py2exe site and I have also uncommeneted and made it include the matplotlib.numerix package. Still it doesnt seem to work. Is there any other way of compiling it into an executable?

Thanks,

Archana.

···

On 4/1/07, Werner F. Bruhin <werner.bruhin@…185…> wrote:

Hi Archana,

Sometimes py2exe can’t figure out what needs to be included. In these
cases one creates entries in the packages section to force the inclusion
of one or multiple packages.

Archana Ganesan wrote:

Hi all,

options = {“py2exe”: {“compressed”: 1,
“optimize”: 2,
“packages”: [“encodings”,

“kinterbasdb”,

                              "pytz.zoneinfo.UTC",
                              #" matplotlib.numerix",

You need to activate/un-comment the matplotlib.numerix line. Also note
that if you only include UTC and you use the timezone stuff in matplot
then a user NOT using UTC, i.e. another timezone will have a problem, it

is therefore better to just include all of pytz.

Werner

Hi Archana,

Archana Ganesan wrote:

Hi,

I tried following the instructions at the py2exe site and I have also uncommeneted and made it include the matplotlib.numerix package. Still it doesnt seem to work. Is there any other way of compiling it into an executable?

Did you try to compile the sample I enclosed the other day? Did that work? If not what error are you getting.

Are you using numpy or ?

Provide a small sample (with no dependencies if possible) which does not work for you with the corresponding setup.py.

Werner

I tried to compile the file and it seems to work (send by Werner).
I'm also interested in the problem since I cannot succeed in compiling too with matplotlib (already followed the instruction found on py2exe) Hope to see how it develop and happy to know if anyone succeed in doing it
Giorgio

···

Hii,

I get the following error.
Traceback (most recent call last):
File “trial.py”, line 1, in ?
File “pylab.pyo”, line 1, in ?
File “matplotlib\pylab.pyo”, line 203, in ?

File “matplotlib\axes.pyo”, line 16, in ?
File “matplotlib\axis.pyo”, line 19, in ?
File “matplotlib\patches.pyo”, line 42, in ?
File “matplotlib\patches.pyo”, line 79, in Patch

File “matplotlib\cbook.pyo”, line 352, in dedent
AttributeError: ‘NoneType’ object has no attribute ‘splitlines’

If I comment it out I am getting the error.

I have installed the following:

Python 2.4.4
http://www.python.org/download/releases/2.4.4/

wxPython runtime
win32-unicode for Python 2.4
http://www.wxpython.org/download.php

matplotlib-0.90.0.win32-py2.4.exe

http://sourceforge.net/project/showfiles.php?group_id=80706

numpy-1.0.1.win32-py2.4.exe

http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103

setup.py is as follows
.

from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

cleanup dist and build directory first (for new py2exe version)

if os.path.exists(“dist/prog”):
shutil.rmtree(“dist/prog”)

if os.path.exists(“dist/lib”):

shutil.rmtree(“dist/lib”)

if os.path.exists(“build”):
shutil.rmtree(“build”)

···

options for py2exe

options = {“py2exe”: {“compressed”: 1,

                 "optimize": 2,
                 "packages": ["encodings",

“kinterbasdb”,

                              "pytz",

                              "matplotlib.numerix",

“email”,

                               ## "numpy"

“PIL”,

                              ],
                # "includes": "matplotlib.numerix.random_array",
                 "excludes": ["MySQLdb", "Tkconstants", "Tkinter", "tcl",

                              "orm.adapters.pgsql", "orm.adapters.mysql"
                 ],
                 "dll_excludes": ["tcl84.dll", "tk84.dll", "wxmsw26uh_vc.dll"]

                 }
     }

zipfile = r"lib\library.zip"

setup(
classifiers = [“Copyright:: your name”,
“Development Status :: 5 Stable”,

                "Intended Audience :: End User",
                "License :: Shareware",
                "Operating System :: Microsoft :: Windows 2000",
                "Operating System :: Microsoft :: Windows XP",

                "Operating System :: Microsoft :: Windows 9x",
                "Programming Language :: Python, wxPython",
                "Topic :: Home Use"
                "Natural Language :: German",

                "Natural Language :: French",
                "Natural Language :: English"],

windows = [wx_emb],

 console = ['trial.py'],
 options = options,

 zipfile = zipfile,
 data_files = [("lib\\matplotlibdata", mpfiles),
                matplotlib.get_py2exe_datafiles() # if you don't use the lib option

(“prog\amaradata”, amaradata),

(“prog\amaradata\Schemata”, amaraschemata),

(“prog\”, python4dll)

               ]

)

trial.py
is as follows.

from pylab import *

x = xrange(10)
plot(x)
savefig(“trial.png”)

Kindly help.

thank you.

Archana.

My trial.py is as follows

On 4/2/07, Werner F. Bruhin <werner.bruhin@…185…> wrote:

Hi Archana,

Archana Ganesan wrote:

Hi,

I tried following the instructions at the py2exe site and I have also
uncommeneted and made it include the matplotlib.numerix package. Still

it doesnt seem to work. Is there any other way of compiling it into an
executable?
Did you try to compile the sample I enclosed the other day? Did that
work? If not what error are you getting.

Are you using numpy or ?

Provide a small sample (with no dependencies if possible) which does not
work for you with the corresponding setup.py.

Werner

Hi Archana,

Archana Ganesan wrote:

...
trial.py is as follows.

from pylab import *

x = xrange(10)
plot(x)
savefig("trial.png")

The setup.py you are using will not work, it is meant for a matplotlib embedded in wx, and even for that some lines are commented out.

Can you try the setup.py I sent yesterday with which I included simple_plot.py, which is a script using pylab as you do in your trial.py.

Werner

Can I post also in that thread or should I open a new one?
I’m also trying the first Werner F. Bruhin example. I saved the setup.py and the example in embedding_in_wx4.py then I run
python.exe setup.py py2exe bdist
When looking for dll, it fails claiming:
Error: wxmsw26u_vc_enthought.dll : No such file or directory
If I had manually ** the file**file:///C:/Python24/Lib/site-packages/wx-2.6.1.0-py2.4-win32.egg/wx/wxmsw26_gl_vc_enthought.dll

in the prog directory, it works fine.

If I add wxmsw26_gl_vc_enthought.dll
to data_files it does not install in the prog directory but in the upperlevel directory.

How could I include it in the right place directly?

···

On 4/5/07, Werner F. Bruhin <werner.bruhin@…185… > wrote:

Hi Archana,

Archana Ganesan wrote:


trial.py
is as follows.

from pylab import *

x = xrange(10)
plot(x)
savefig(“trial.png”)

The setup.py you are using will not work, it is meant for a matplotlib

embedded in wx, and even for that some lines are commented out.

Can you try the setup.py I sent yesterday with which I included
simple_plot.py, which is a script using pylab as you do in your trial.py.

Werner


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your

opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

when putting the full path of wxmsw26u_vc_enthought.dll in setup.py like this

data_files = [(“lib\matplotlibdata”, mpfiles),
matplotlib.get_py2exe_datafiles(), # if you don’t use the lib option
“C:\Python24\Lib\site-packages\wx-2.6.1.0-py2.4-win32.egg\wx\wxmsw26u_vc_enthought.dll”,

“wxmsw26u_vc_enthought.dll”,

(“prog\”, python4dll)

               ]

and copying wxmsw26u_vc_enthought.dll in the same directory where setup.py is.
Running
python setup.py py2exe
it works “but” gives a 26Mb large dist directory with a lot of files. A good start.

I’d like to know if it’s possible to bundle all files in a zipped files or something similar

What I obtain in dist is:

[___lib
[___matplolibdata
[___matplotlibdata
[___prog

Files in lib are .pyd,library.zip,wxmsw26u_vc_enthought.dll
Files in lib\matplotib are .afm,.ppm,
.svg …
Files in matplotib are the same as in lib\matplotib

FIles in prog are MSVCR71.dll,python24.dll,w9xpopen.exe,wx_embed.exe

···

On 4/8/07, Emmanuel <emmanuel@…1321…> wrote:

Can I post also in that thread or should I open a new one?
I’m also trying the first Werner F. Bruhin example. I saved the setup.py and the example in embedding_in_wx4.py then I run
python.exe setup.py py2exe bdist
When looking for dll, it fails claiming:
Error: wxmsw26u_vc_enthought.dll : No such file or directory
If I had manually ** the file**file:///C:/Python24/Lib/site-packages/wx-2.6.1.0-py2.4-win32.egg/wx/wxmsw26_gl_vc_enthought.dll

in the prog directory, it works fine.

If I add wxmsw26_gl_vc_enthought.dll
to data_files it does not install in the prog directory but in the upperlevel directory.

How could I include it in the right place directly?

On 4/5/07, Werner F. Bruhin < > werner.bruhin@…185… > > wrote:

Hi Archana,

Archana Ganesan wrote:

trial.py
is as follows.

from pylab import *

x = xrange(10)
plot(x)
savefig(“trial.png”)

The setup.py you are using will not work, it is meant for a matplotlib

embedded in wx, and even for that some lines are commented out.

Can you try the setup.py I sent yesterday with which I included
simple_plot.py, which is a script using pylab as you do in your trial.py.

Werner


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your

opinions on IT & business topics through brief surveys-and earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net


https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi Emmanuel,

Maybe your problem has to do with your "enthought" build of wxPython. I
use standard builds from wxPython site.

Emmanuel wrote:

when putting the full path of wxmsw26u_vc_enthought.dll in setup.py like this

data_files = [("lib\\matplotlibdata", mpfiles),
                    matplotlib.get_py2exe_datafiles(), # if you don't use the lib option

You get two copies of matplotlibdata as you kept both of the two above
lines active. You need to use the first one of you use the py2exe
option to create a library.zip which I put into a sub-folder called
'lib' in the sample setup.py file.

"C:\\Python24\\Lib\\site-packages\\wx-2.6.1.0-py2.4-win32.egg\\wx\\wxmsw26u_vc_enthought.dll",
## "wxmsw26u_vc_enthought.dll",
#### ("prog\\", python4dll)
                   ]

You are also using an 'egg'. I seem to recall that py2exe does not yet
really support that, but you might want to check on the py2exe list
(e.g. on the gmane mirror of it at
http://dir.gmane.org/gmane.comp.python.py2exe

Werner

Hi Werner,

I tried what you suggested, using the setup file you had provided for simple_plot.py. But I get the following error, what should I do abt this?
Traceback (most recent call last):
File “simple_plot.py”, line 1, in ?

File “pylab.pyo”, line 1, in ?
File “matplotlib\pylab.pyo”, line 203, in ?
File “matplotlib\axes.pyo”, line 16, in ?
File “matplotlib\axis.pyo”, line 19, in ?
File “matplotlib\patches.pyo”, line 42, in ?
File “matplotlib\patches.pyo”, line 79, in Patch
File “matplotlib\cbook.pyo”, line 352, in dedent
AttributeError: ‘NoneType’ object has no attribute ‘splitlines’

Could you please tell me what I should do?

Thanks a lot,

Archana.

···

On 4/9/07, Werner F. Bruhin < werner.bruhin@…185…> wrote:

Hi Emmanuel,

Maybe your problem has to do with your “enthought” build of wxPython. I

use standard builds from wxPython site.

Emmanuel wrote:

when putting the full path of wxmsw26u_vc_enthought.dll in setup.py
like this

data_files = [(“lib\matplotlibdata”, mpfiles),

                matplotlib.get_py2exe_datafiles(), # if you don't

use the lib option
You get two copies of matplotlibdata as you kept both of the two above
lines active. You need to use the first one of you use the py2exe

option to create a library.zip which I put into a sub-folder called
‘lib’ in the sample setup.py file.

"C:\Python24\Lib\site-packages\wx-2.6.1.0-py2.4-win32.egg\wx\wxmsw26u_vc_enthought.dll
",

“wxmsw26u_vc_enthought.dll”,

(“prog\”, python4dll)

               ]

You are also using an ‘egg’. I seem to recall that py2exe does not yet

really support that, but you might want to check on the py2exe list
(e.g. on the gmane mirror of it at
http://dir.gmane.org/gmane.comp.python.py2exe

Werner


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your

opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users