-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: cannot import name '_imaging' #3088
Comments
By the way, I have already tried to remove both PIL and pillow and then reinstalling them. |
|
Still getting the same error. This is in the PIL package that was pip installed along with Pillow, by the way. More context of the Image.py file: 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 PIL import _imaging
if PILLOW_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),
PILLOW_VERSION)) |
Please can you paste the full traceback? How did you install? You don't want to install PIL separately, only pip install pillow. |
@nchouard You should |
Pillow was installed using pip. When I install pillow, however, it installs PIL as well. Is this an issue? |
@aclark4life Ok, thanks. That is exactly what I do. The issue seems to be stemming from the error in the PIL/Image.py file though... |
@nchouard If you look at the source code right above line 60 you'll see this::
I think next you should paste the output of |
Yes, this is mod_wsgi.
|
The _imaging file is present under the name: _imaging.cpython-36m-x86_64-linux-gnu.so |
@nchouard If you can |
It looks like you're right, it's an issue with mod_wsgi and what it was compiled against. Thanks a lot for your help! |
I though this is about an imaging library. Why do I need an Apache module?
|
@nise you don't, this is just a discussion about the problem that @nchouard was having when running Pillow in a Python hosted web application |
get the same error running Pillow on AWS Lambda. |
I had the same error as pedrodparkes on running pillow with Lambda, any fixes? |
@gweiying None that I know of, unless you, or someone reading this, are providing one in a pull request. Also, this ticket is closed? So presumably already fixed in latest Pillow, or being addressed in another issue somewhere. |
The original issue was solved, please open a new issue with details, or you may get a quicker answer on Stack Overflow: |
I ran into this problem using Pillow with Serverless + AWS Lambda too |
@patricio-ezequiel-hondagneu-roig did you find a solution? |
I fixed an issue by preparing Lambda archive on Linux. It fails on Mac in the way described above. |
i tried pip uninstall pillow multiple times, and then did pip install pillow. |
I had the same problem with aws lambda when i update to python3.8, in my case a deployed using zappa==0.51.0 and Pillow==7.2.0, it turn out a forgot to change my runtime to "runtime": "python3.8" on the zappa_settings.json. I hope it helps someone else |
I'm having the this issue when using actions to build and deploy AWS Lambda with serverless. Anyone got a clue what should I do? |
There are no solution for AWS Lambda with serverless? |
same issue in lambda no clue |
The original issue was solved, please open a new issue with details, or you may get a quicker answer on Stack Overflow: |
What did you do?
Importing Pillow as a part of a flask project.
What did you expect to happen?
Pillow to be imported properly.
What actually happened?
What versions of Pillow and Python are you using?
I'm using Python 3.5 and Pillow 5.1.0 on Ubuntu 16.
The text was updated successfully, but these errors were encountered: