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.11:53:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
After further tests, I think I figured out how things works.
There are three separate things that interact with each other:
  * packages (dirs with an and "regular" dirs (with no or zip files;
  * how python is executed (with or without -m);
  * if the pkg/dir/zip is executed or imported. makes a pkg/dir/zip "executable", but:
  * if it's a package, "python -m pkg" should be used;
  * if it's a dir or zip, "python dir_or_zip" should be used instead.

There seem to be no differences between "regular" dirs and zip files:
  * both can become executable with a;
  * both should be executed with "python dir_or_zip" (no -m);
  * both can not be imported (if we ignore namespace packages);
  * both can be added to sys.path, and the modules they contain imported, without needing any

This also means that is used only while doing "python -m pkg" or "python dir_or_zip", and not while doing "import pkg" or while importing a module inside a dir/zip.
Date User Action Args
2015-07-15 11:53:28ezio.melottisetrecipients: + ezio.melotti, nedbat, docs@python, ethan.furman
2015-07-15 11:53:28ezio.melottisetmessageid: <>
2015-07-15 11:53:28ezio.melottilinkissue24632 messages
2015-07-15 11:53:28ezio.melotticreate