Yo Fred! On Wed, 27 Sep 2017 19:02:23 -0700 (PDT) Fred Wright via devel <devel@ntpsec.org> wrote:
> First of all, in order for an import to work in Python, the directory > containing the module needs to be in sys.path at the time of the > import. This requirement can be met in one of two ways: Yup. > One of the ways to do #1 is to use the path returned by > get_python_lib() without the prefix option. This is what GPSD has > done for years. And caused subtl problems for years. > 2.2) Make use of some sort of hook to augment sys.path, which is what > pip appears to do. So far, this approach doesn't look promising, > partly because the only such mechanisms seem to require that the hook > itself be in a "non-local" location in order to be seen by Python > before being applied. A chicken-and-egg problem. Huh? Looks simple to me. Looks like the preferred solution. Since pip, and many other programs do it, that is a lot of good precendent. > 2.3) Add code to the programs to augment sys.path prior to the import. Gack. Breaks in a large number of ways. It is very common for packaers to build to one path, package the results, then install elsewhere. RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703 g...@rellim.com Tel:+1 541 382 8588 Veritas liberabit vos. -- Quid est veritas? "If you can’t measure it, you can’t improve it." - Lord Kelvin
pgpLzCbaqO3ml.pgp
Description: OpenPGP digital signature
_______________________________________________ devel mailing list devel@ntpsec.org http://lists.ntpsec.org/mailman/listinfo/devel