First attempt at python, interactive session, showed that tkinter could not be located. Maybe python3 then; that was OK. Proceeded with the lessons. Let's try to show an image. This was the header section of the script:
- Code: Select all
#!/bin/env python3
from tkinter import *
from tkinter import ttk
from PIL import Image, ImageTk
This resulted in an error message
- Code: Select all
ImportError: cannot import name 'ImageTk'
From an interactive session using python it was possible to import ImageTk, but as said, no tkinter although there was a test_tkinter directory on the python2.7 hierarchy. Using python3, tkinter is available and python-pillow (PIL) supplies Image but not ImageTk. (Image handles GIF and bitmap formats only.)
- Code: Select all
[lcl@belexeuli ~/python]$ locate ImageTk
/usr/lib64/python2.7/site-packages/PIL/ImageTk.py
/usr/lib64/python2.7/site-packages/PIL/ImageTk.pyc
/usr/lib64/python3.4/site-packages/PIL/__pycache__/ImageTk.cpython-34.pyc
/usr/lib64/python3.4/site-packages/PIL/__pycache__/ImageTk.cpython-34.pyo
Before that I had discovered pip and upgraded it to pip-7.1.2 then upgraded Pillow.
- Code: Select all
[lcl@belexeuli ~/python]$ sudo urpmi python3-pillow
Package python3-pillow-2.6.2-2.mga5.x86_64 is already installed
[lcl@belexeuli ~/python]$ sudo pip install --upgrade Pillow
...
Successfully installed Pillow-2.9.0
So, is there a way out of this Catch-22 situation or have I messed things up by indiscriminate upgrades?