Changes between Initial Version and Version 1 of Ticket #14087, comment 9
- Timestamp:
- Mar 1, 2012, 5:11:48 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #14087, comment 9
initial v1 2 2 3 3 I did a bit more investigation why the init file is being skipped. The skipping of the init file happens when you use the "--single-version-externally-managed" option during install (e.g. python setup.py install --single-version-externally-managed). Pip automatically adds this option by default and as far as I can read it's also used by system package builders (like e.g. Debian or rpms). What setuptools does with this option is to add a .pth file for each part of a namespace module - e.g.: 4 4 {{{ 5 5 site-packages/ 6 <namespace pac akge>_app1_<version>-nspkg.pth7 <namespace pac akge>_app2_<version>-nspkg.pth6 <namespace package>_app1_<version>-nspkg.pth 7 <namespace package>_app2_<version>-nspkg.pth 8 8 ... 9 <namespace pac akge>/app110 <namespace pac akge>/app211 9 <namespace package>/app1 10 <namespace package>/app2 11 }}} 12 12 The pth files contains a bit of python which will be loaded by the '''site''' module when you start python. This piece of code in the pth file will add <namespace pacakge> as a builtin module and set the modules __path__ variable. So while find_module will not be able to locate the module, the module will already be loaded and available in sys.modules. 13 13