This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients docs@python, ethan.furman, ezio.melotti, nedbat
Date 2015-07-15.07:15:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Another thing that should be clarified, is the difference between inside a package, and inside a zip file.

For packages, as far as I understand, should be inside the package (i.e. pkg/, in the same dir of pkg/
This allows the package to be "executed" by doing "python3 -m pkg".

For zip files, the should be right inside the zip (i.e.
This allows the zip file to be "executed" by doing "python3" (note that no -m is used here, and that "python3 -m" fails).

While zipping a package that already contains a, the right way to do it seems to be the following:
1) add the package to a zip file (i.e.
2) add another to the zip (i.e.
3) add 'import pkg.__main__' to
now if you do "python3", will be executed, and in turn it will import, obtaining a result equivalent to "python -m pkg".

(I still haven't figured out if the is necessary while /importing/ a package/module from a zip file, after having added the zip file to sys.path.)

So, to summarize, it seems to me that:
1) pkg/ is necessary to run "python3 -m pkg" (with -m);
2) is necessary to run "python3" (without -m);
3) due to 1) and 2) creating an executable zipped package requires 2;
4) "python3 pkg" and "python3 -m" are not supposed to work even if the files are in the right place.
Date User Action Args
2015-07-15 07:15:37ezio.melottisetrecipients: + ezio.melotti, nedbat, docs@python, ethan.furman
2015-07-15 07:15:37ezio.melottisetmessageid: <>
2015-07-15 07:15:37ezio.melottilinkissue24632 messages
2015-07-15 07:15:37ezio.melotticreate