2

Python (3.5) is not finding a file that is in a directory and I am trying to figure out where to put it. Here is the error I get:

Traceback (most recent call last):
  File "/home/rik/Pillow/faces.py", line 35, in <module>
    from PIL import Image
  File "/home/rik/Pillow/PIL/Image.py", line 67, in <module>
    from PIL import _imaging as core
ImportError: cannot import name '_imaging'

But I have a file called '_imaging.c' in the folder /home/rik/Pillow/ and I tried putting it in /home/rik/Pillow/PIL/ with no luck.

I tried to track where it is getting file via strace but I got an error:

rik@rik-MS-7971:~$ chmod +x /home/rik/Documents/tensorflow/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py
rik@rik-MS-7971:~$ strace -f -e open /home/rik/Documents/tensorflow/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py
strace: exec: Exec format error
Rik
  • 489

1 Answers1

2

You mentioned in a comment below the original question that you installed Pillow with pip however you have Python 3.5 installed and pip3 install pillow is only supported for versions of Python <= Python 3.4.

Pillow is packaged as python-pil and python3-pil in all currently supported versions of Ubuntu, and it has replaced the discontinued PIL project in the default Ubuntu repositories since Ubuntu 13.04. You should uninstall pillow that you installed with pip and install python-pil and/or python3-pil instead.

karel
  • 122,292
  • 133
  • 301
  • 332