obspy vs py2exe

Dear All,

I'm struggling to have my project building correctly using py2exe because of the obspy namespace. I usually do the following :

includes.append('scipy')
includes.append('xml')
includes.append('xml.etree')
includes.append('xml.etree.*')

etc...

so, for obspy :

includes.append('obspy')
includes.append('obspy.*')
includes.append('obspy.core')
includes.append('obspy.signal')
includes.append('obspy.gse2')
includes.append('obspy.mseed')
includes.append('obspy.sac')

But the setup script can't find the packages. I installed them using easy_install. Is it an *.egg/ related problem ?

Thanks,

Thom

Dear,

For what I can tell, it's really a problem with py2exe versus namespace packages.

Would it be possible to put all obspy folders together and get a working package, something like :

/obspy/
/obspy/__init__.py
/obspy/core
/obspy/gse2
/obspy/mseed

??

Cheers,

Thomas

Hi Thomas,

I guess you had a look at this already:
http://www.py2exe.org/index.cgi/ExeWithEggs

I was also trying to use py2exe but ended up writing a Windows installer similar to the one used for obspy itself:
http://obspy.org/browser/obspy/trunk/misc/installer/win-py2.6/setup.nsi

I read somewhere, that pyinstaller (http://www.pyinstaller.org/) works better with eggs than py2exe but I didn't try it myself.

If you manage to get py2exe running with obspy it would be great if you posted your solution on this list.

Best,
Yannik

Hi Thomas,

I have no experience with py2exe at all, but here just some comment
witch might help:

ObsPy it self uses the concept of namespace packages - the package
"obspy" itself doesn't exists so either try only including

includes.append('obspy.core')
includes.append('obspy.signal')
includes.append('obspy.gse2')
includes.append('obspy.mseed')
includes.append('obspy.sac')

or if this is not working try merging all needed packages into one big
package called obspy - make sure to merge the entry_points keywords in
the setup.py.

Good luck,
Robert

Dear all,

I found quite a solution to this. I created an example just to display the Traces stats, then struggled… a lot… but using the ExeWithEggs explanation + some tuning, I finally managed to get it working.

I pulished the recipe on my page : Note, the important thing in order to use AND obspy from eggs AND numpy from installers is to REMOVE the numpy line from the obspy.core --> requires.txt file. The result is ~40MB large (because of numpy and matplolib), but I don’t really care. Now I can use obspy modules inside my other applications and release it .exe to my windows colleagues ! Cheers, Thom Le 09/08/2011 14:39, Thomas Lecocq a écrit :

Hi Thomas,

Thanks for your tutorial. I’m sure that will be very helpful for everyone using obspy with py2exe.

Cheers,
Yannik