2

I am using Anaconda with python 3.4 and I am not able to get all the pillow packages I need I am afraid on Windows 8.1.

I installed pillow via the Anaconda console with:

pip install pillow

which lead to:

The following packages will be UPDATED:

    conda:      3.10.0-py34_0 --> 3.10.1-py34_0
    conda-env:  2.1.3-py34_0  --> 2.1.4-py34_0
    pillow:     2.7.0-py34_0  --> 2.8.1-py34_0
    pip:        6.0.8-py34_0  --> 6.1.1-py34_0
    setuptools: 14.3-py34_0   --> 15.0-py34_0

Now, in the spyder IPython console I start with: import tkinter, from PIL import ImageTk I have no errors here, but when executing ImageTk.PhotoImage(file='a.jpg') I receive an error, telling me: ImportError: cannot import name '_imagingtk'

What did I miss?

xtlc
  • 1,070
  • 1
  • 15
  • 41

2 Answers2

1

I know this is not a complete answer, but I have had the same problem and spent a day trying to figure it out... Here is a small subset of things I tried yesterday to the best of my weak memory... -Tried upgrating to the latest Python environment using anaconda (tip: you can create one using

conda update conda 
conda update anaconda
(I think that's it, but may have tried to make sure for key packages explicitly etc.)

-Tried using Python 3.3 environment using anaconda (tip: you can create one using

conda update conda 
conda create -n py33 python=3.3 anaconda
activate py33

-Tried using PythonWin instead of anaconda (that one took some time, had to install packets like numpy manually...)

-Tried updating / downgrading / installing/ uninstalling all kinds of different variations of Pillow, PIL, etc....

-Tried using opencv instead of PIL, though did not try to write my own components...

-Tried manually copying Tcl/tk and a few others to the lib directory as suggested by some posts

-Tried using import tkinter instead of Tkinter, using import Image vs. form PIL import Image (and in general taking Image from PIL, or opencv, or Tkinter) and a lot of other similar changes to the point it fell I was doing silly things

-...

At the end, I googled a few pages about GUIs in python, and now I am using wx... I had to run

conda install wxpython

and that was it. I have to say that after all this, I am presently surprised by how easy it was to make it work, here is a code example...

ntg
  • 12,950
  • 7
  • 74
  • 95
-1

You need tcl/tk library.

Install them using apt-get

Do sudo apt-get install tk8.6-dev tcl8.6-dev

--Reference.

Vaibhav Mule
  • 5,016
  • 4
  • 35
  • 52