Opened 5 years ago
Closed 5 years ago
#833 closed task (fixed)
pillow 2.8.x packaging on win32: workaround pkg_resources import
Reported by: | Antoine Martin | Owned by: | Antoine Martin |
---|---|---|---|
Priority: | critical | Milestone: | 0.15 |
Component: | android | Version: | trunk |
Keywords: | Cc: |
Description
The loader code in PIL/_webp.py
(which is called by the PIL/WebPImagePlugin.py
looks like this:
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import imp, pkg_resources __file__ = pkg_resources.resource_filename(__name__, '_webp.pyd') __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
And we just can't import pkg_resources
and its gazillions of dependencies, so the import fails.
I've successfully tested this hardcoded workaround (after copying the _webp.pyd
by hand to the installation directory:
def __bootstrap__(): global __bootstrap__, __loader__, __file__ print("bootstrap() file=%s" % __file__) print("bootstrap() name=%s" % __name__) import imp try: import pkg_resources __file__ = pkg_resources.resource_filename(__name__, '_webp.pyd') print("bootstrap() pkg_resources file=%s" % __file__) except: __file__ = "C:\\Program Files\\Xpra\\_webp.pyd" print("no pkg_resources, trying from %s" % __file__) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
Change History (2)
comment:1 Changed 5 years ago by
Status: | new → assigned |
---|
comment:2 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Turns out that we can just force include the webp plugin (r8922) and py2exe does everything for us!
Note: See
TracTickets for help on using
tickets.
Here's a cleaner workaround: