[Distutils] Problem importing pylirc egg

Philippe Normand philippe at fluendo.com
Mon Apr 24 21:22:43 CEST 2006


Le 24/4/2006, "Ian Bicking" <ianb at colorstudy.com> a écrit:
>
>What's in /home/phil/lib/python2.4/pylirc-0.0.5-py2.4-linux-i686.egg ?
>What does your sys.path look like after you do the require()?  That path
>should be on your sys.path after require(), and it should contain
>pylirc/__init__.py (or be a zip file that includes pylirc/__init__.py).
>

sys.path contains full path to the egg, even without requiring pylirc.

The .egg is a zip file containing:

Archive:  pylirc-0.0.5-py2.4-linux-i686.egg
  inflating: pylircmodule.so
  inflating: pylircmodule.py
  inflating: pylircmodule.pyc
  inflating: EGG-INFO/PKG-INFO
  inflating: EGG-INFO/top_level.txt
  inflating: EGG-INFO/SOURCES.txt
  inflating: EGG-INFO/native_libs.txt
  inflating: EGG-INFO/zip-safe

pylircmodule.py isn't part of the "official" pylirc distribution.
Seems like it was generated by setuptools. But if there's a .so with
the same name, it will confuse things, no ? That generated file contains:

def __bootstrap__():
   global __bootstrap__, __loader__, __file__
   import sys, pkg_resources, imp
   __file__ =
pkg_resources.resource_filename(__name__,'pylircmodule.so')
   del __bootstrap__, __loader__
   imp.load_dynamic(__name__,__file__)
__bootstrap__()

Philippe


More information about the Distutils-SIG mailing list