[Distutils] executable egg & top-level __main__.py

Dimitri Maziuk dmaziuk at bmrb.wisc.edu
Thu Jun 18 22:46:34 CEST 2015


Hi all,

I have the following directory structure:

myegg/
    pkg1/
        __init__.py
        ...
    pkg2/
        __init__.py
        ...
    pkg3/
        __init__.py
        ...
    setup.py
    __main__.py

If I zip this into myegg.egg and run "python myegg.egg", that runs the
top-level __main__.py. If I run "python setup.py bdist_egg" and run the
resulting egg, I get "/usr/bin/python: can't find '__main__.py'" in the
egg. That is correct: according to "unzip -l" __main__.py is not there.

How do I get it included?

Or more to the point, how do I make that egg directly executable? --
note that I want it to run a script that isn't in any of the bundled
packages (but imports from them).

(centos 6 with python 2.6 and python-setuptools-0.6.10 and centos 7 with
python 2.7 and python-setuptools-0.9.8)
-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20150618/66c0f927/attachment-0001.sig>


More information about the Distutils-SIG mailing list