[Distutils] problem finding an entry point
Kevin Dangoor
dangoor at gmail.com
Tue Sep 5 13:56:21 CEST 2006
On 9/1/06, Phillip J. Eby <pje at telecommunity.com> wrote:
> I think you're going to need to be more specific here. I'm not clear on
> what is being found when, by what. I'm also not clear what is being
> symlinked where.
OK, here are specifics....
Things in /base/pkg/Foo/usr/local/lib/python2.4/site-packages are
linked over to /usr/local/lib/python2.4/site-packages. (I doubt it
makes a difference, but this whole thing is actually run in a chrooted
environment...) It appears that in most instances (and I don't know
enough about the packager to know which instances and why), the
directories are real directories, but the files inside are symlinks.
Specifically:
/usr/local/lib/python2.4/site-packages/nose would be a real directory
/usr/local/lib/python2.4/site-packages/nose/result.py is a symlink to
/base/pkg/Foo/usr/local/lib/python2.4/site-packages/nose/result.py
There's a nose-0.9.0-py2.4.egg-info directory next to the nose
directory (again, the directory is real but the files inside are
symlinks).
One more important thing to know about this setup. We have a couple of
different packages in /base/pkg, and they both contribute to
/usr/local/lib...
When you run python, the /baes/pkg... path for the package that
contains Python is what shows up in sys.path (not
/usr/local/lib/python2.4/site-packages). We created a sitecustomize.py
file to add /usr/local/lib/python2.4/site-packages as a sitedir. We're
able to import all of the python packages from that directory just
fine. But, I wrote a nose plugin that is only found if I explicitly
set a PYTHONPATH environment variable to point to
/usr/local/lib/python2.4/site-packages.
>From the Python prompt, if I iter_entry_points, I don't see my plugin
without the PYTHONPATH. However, I can require my package and see the
entry point via the API.
Hopefully that makes it clearer...
Kevin
More information about the Distutils-SIG
mailing list