From: Tom v. d. H. <To...@va...> - 2011-01-29 10:41:46
|
Hello, I work a few month with python now. I want to deploy an application with matplotlib. On some machines I got it working, on other machines not. Can somebody instruct me exactly what to do to get the following test.py working with py2exe on any windows machine xp and later. test.py : import matplotlib.pyplot as plt plt.plot([1,2,3]) plt.ylabel('some numbers') plt.show() I have already invested several days, I must do something obvious wrong. I am working with the pythonxy bundle 2.6.5.6 Python 2.6 py2exe 0.6.9 matplotlib 1.0.0 Tom |
From: Mark H. <ski...@gm...> - 2011-01-31 07:53:12
|
On 29/01/2011 9:41 PM, Tom van der Hoeven wrote: > Hello, > > I work a few month with python now. > I want to deploy an application with matplotlib. > On some machines I got it working, on other machines not. Some details about what "not" means might help... Mark |
From: Mark H. <mha...@sk...> - 2011-01-31 22:13:11
|
Please keep replies on-list On 31/01/2011 9:00 PM, Tom van der Hoeven wrote: > Dear Mark, > > thanks for your attention > I did not give details because I thougt there must be a setup file and a > procedure that always works, > so I did not want to bother the audiance with one of my trials. > Anyway, you asked for some details and I tried to make a setup that > worked somehow (enclosed). > I copied the file msvcr90.dll on forehand in the directory f:\pyt > I made the exe on machine A > I deployed to machine B > - on A: it worked but only one icon is on the toolbar > - on B: I get the message : The system cannot execute the specified program Is that the exact and complete message on B? What is the difference between A and B (eg, what OS are they, 32 or 64bit, etc) Cheers, Mark |
From: Tom v. d. H. <To...@va...> - 2011-01-31 23:10:29
|
Dear Mark, I get it running !?!?!? I started all over again hello world machine A, machine B test (small matplotlib graph) machine A machine B Berg (My real application) machine A machine B B is just an old XP machine The clue is in the right setup file and the right procedure setup file : enclosed procedure : copy the map Microsoft.VC90.CRT out of the pythonxy distribution and copy the map mpl-data out of python26 Because I have no complete view, the dist directory may be to large I have only 3 deficiencies left - There are icons missing on the toolbar, there is only one left - on machine B the figure disappear if my mouse is on the wrong place (mayby the machine is wrong, so don't bother) - if I make PNG's instead of sceen figures, they appear in the root directory (mayby I do something wrong, so don't bother) So I am quite happy and will have a good sleep (it is midnight now) I had a good start with Python over the last 2 month I am a little disapointed about deployment : py2exe, different versions of python, matplotlib, dll's , you have to dive deep, it is not transparant. The company I work for is a dot net company Should I change to Jython or IronPython, or do I get more problems with matplotlib I saw you have written books about it. So far Mark, thank you for your attention. Tom |
From: Tom v. d. H. <To...@va...> - 2011-02-04 14:11:12
|
For the record ---------------graf.py-------------- import matplotlib.pyplot as plt plt.plot([1,2,3,8,0,9,1,10,5]) plt.ylabel('some numbers') plt.show() ------------ setup.py -------------- from distutils.core import setup import py2exe import matplotlib name = 'graf.py' INCLUDES = [ 'sip' , 'matplotlib.numerix.random_array' # , 'PyQt4._qt' , 'matplotlib.backends' , 'matplotlib.backends.backend_qt4agg'] #['matplotlib.backends.backend_qt4agg'] EXCLUDES = [] [ '_gtkagg' , '_tkagg' , 'Tkconstants' , 'Tkinter' ,'tcl' ] #['_tkagg' , '_ps' , '_fltkagg' , 'Tkinter' , 'Tkconstants' , '_cairo' , '_gtk' , 'gtkcairo' , # 'pydoc' , 'sqlite3' , 'bsddb' , 'curses' , 'tcl' , '_wxagg' , '_gtagg' , '_cocoaagg' , '_wx' ] DLL_EXCLUDES = ['MSVCP90.dll'] ICON_RESOURSES = [] OTHER_RESOURCES = [] DATA_FILES = matplotlib.get_py2exe_datafiles() setup(name = name, version = '1.0', options = { "py2exe" : { 'compressed' : 1, 'optimize' : 2, 'bundle_files' : 2, 'includes' : INCLUDES, 'excludes' : EXCLUDES, 'dll_excludes' : DLL_EXCLUDES } } , console = [ { 'script' : name, 'icon_resources' : ICON_RESOURSES, 'other_resources' : OTHER_RESOURCES, } ] , description = 'Hele mooie', author = 'Tom van der Hoeven', author_email = 'To...@va...' , maintainer = 'Tom van der Hoeven', maintainer_email = 'To...@va...', license = '', url = 'http://projecthomepage.com', data_files = DATA_FILES, ) |