ImportError: Unable to import name '_imagingtk'

I am using Anaconda with python 3.4 and I cannot get all the pillow packages I need. I'm scared on Windows 8.1.

I installed the pillow through 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 IPython spyder console, I start with: import tkinter, from PIL import ImageTk

I have no errors here, but when ImageTk.PhotoImage(file='a.jpg')

I execute I get an error:ImportError: cannot import name '_imagingtk'

What did I miss?

+2


source to share


2 answers


I know this is not a complete answer, but I had the same problem and spent a day trying to figure it out ... Here are a small part of the things I tried yesterday to the best of my weak memory ... -Tried upgrating to the last Python environments with anaconda ( hint : you can create it with

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

      

-tried using Python 3.3 environment using anaconda ( hint : you can create it with

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

      

-Quited using PythonWin instead of anaconda (which took a while, had to install packages like numpy manually ...)

- Past update / downgrade / install / uninstall of all kinds of different options for pillow, PIL, etc.

- Rubbed using opencv instead of PIL, although not trying to write my own components ...



-Added to manually copy Tcl / tk and a few others to lib directory as suggested by some posts

-Tried using import tkinter instead of Tkinter, using import image versus PIL form import Image (and generally grabbing an image from PIL, or opencv, or Tkinter) and many other similar changes the moment it crashed I was doing stupid things

-...

In the end I looked at some pages about GUI in python and now I am using wx ... I had to run

conda install wxpython

      

that's all. I have to say that after all this, I am currently surprised at how easy it was to get it to work, here is some sample code ...

+1


source


You need the tcl / tk library.

Install them with apt-get



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

- Link .

-1


source







All Articles