Unfortunately, @vpeter, that doesn’t seem to help. Rather than editing source anywhere, I just gave both of the following a try after invoking /opt/bin/python3
:
>>> from PIL import _imaging
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name '_imaging' from 'PIL' (/opt/lib/python3.8/site-packages/PIL/__init__.py)
and, in a separate run:
>>> from PIL import ImageFont
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/lib/python3.8/site-packages/PIL/ImageFont.py", line 33, in <module>
from . import Image
File "/opt/lib/python3.8/site-packages/PIL/Image.py", line 94, in <module>
from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/opt/lib/python3.8/site-packages/PIL/__init__.py)
For both, the import in question that actually fails is from PIL/Image.py
itself, in the try/except block below. The exception that is supposed to get caught is indeed ImportError, but I don’t think any of the conditions listed match. This form of import is the “modern” version per the third warning box on this page:
Pillow >> Docs >> Installation
I’m wondering if pillow was built correctly for Entware…
Cheers,
Matt
from PIL/Image.py
try:
# If the _imaging C module is not present, Pillow will not load.
# Note that other modules should not refer to _imaging directly;
# import Image and use the Image.core variable instead.
# Also note that Image.core is not a publicly documented interface,
# and should be considered private and subject to change.
from . import _imaging as core
if __version__ != getattr(core, "PILLOW_VERSION", None):
raise ImportError(
"The _imaging extension was built for another version of Pillow or PIL:\n"
"Core version: %s\n"
"Pillow version: %s" % (getattr(core, "PILLOW_VERSION", None), __version__)
)
except ImportError as v:
core = deferred_error(ImportError("The _imaging C module is not installed."))
# Explanations for ways that we know we might have an import error
if str(v).startswith("Module use of python"):
# The _imaging C module is present, but not compiled for
# the right version (windows only). Print a warning, if
# possible.
warnings.warn(
"The _imaging extension was built for another version of Python.",
RuntimeWarning,
)
elif str(v).startswith("The _imaging extension"):
warnings.warn(str(v), RuntimeWarning)
# Fail here anyway. Don't let people run with a mostly broken Pillow.
# see docs/porting.rst
raise