[BioPython] Problems building biopython-based script with py2exe

Leighton Pritchard lpritc at scri.sari.ac.uk
Tue Feb 3 05:12:22 EST 2004


Hi Brad,

At 00:26 03/02/2004, Brad Chapman wrote:
>Thanks for looking into this problem -- I know nothing at all about
>py2exe and very little about the registry import magic going on
>there. I checked your changes into Bio/__init__.py

Many thanks - my first contribution.  I'm quite chuffed with that.

>Could you please verify that I did everything right and didn't mess
>anything up on typing it up? Ugh, all those list comprehensions and
>import hacks and my head is a bit tired right now; so hopefully I
>did a decent job.

Just off by a couple of typos:

line 54:
     config_imports = __import__("Bio.config", {}, {}, ["Bio"]).__file__)
should be (don't need __file__ attribute)
     config_imports = __import__("Bio.config", {}, {}, ["Bio"])

line 57:
     if hasattr(config_imports, '__loader__':
should be (missing parenthesis):
     if hasattr(config_imports, '__loader__'):

line 66:
         x = os.listdir(config_imports.__file__))
should be (os.path.dirname call):
         x = os.listdir(os.path.dirname(config_imports.__file__))

But I can't guarantee having caught everything ;)

>Thanks again for looking into this!
>Brad

No problem - a rationale for what's there is at the py2exe wiki: 
http://starship.python.net/crew/theller/moin.cgi/FrontPage

Cheers,


Dr Leighton Pritchard AMRSC
D104, PPI, Scottish Crop Research Institute
Invergowrie, Dundee, DD2 5DA, Scotland, UK
E: lpritc at scri.sari.ac.uk
T: +44 (0)1382 568579           F: +44 (0)1382 568578
PGP key FEFC205C: http://www.keyserver.net http://pgp.mit.edu




More information about the BioPython mailing list