text: Code: Select all
  sudo apt-get install python-pil
  How can I fix this?How can I fix this?Reading package lists... Done
  Building dependecy tree
  Reading state information... Done
  E: Unable to locate package python-pil
  I replaced it. But now I am getting the following error:I replaced it. But now I am getting the following error:gkreidl wrote:replace
  from tkinter import *
  to
  import tkinter
  Then your code should work.
  Traceback (most recent call last):
  File "/home/pi/tkinterpy1.py", line 2, in <module>
  root = Tk()
  NameError: name 'Tk' is not defined
  Wow. Thank you for informing me! Do you know of any alternatives that I could use to display an image?Wow. Thank you for informing me! Do you know of any alternatives that I could use to display an image?joan wrote:The PIL Image show function used to use a program called xv to display the image on *nix systems.
  xv has been effectively deprecated for some time.
  That might be why you get no display.
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
  or: setup.py --help [cmd1 cmd2 ...]
  or: setup.py --help-commands
  or: setup.py cmd --help
  I was trying to do something like:I was trying to do something like:DirkS wrote: How did you try to use it?
  Code: Select all
  from PIL import image global ext ext = ".jpg" imageFile = "test.jpg" img = Image.open(imageFile)
  Code: Select all
  import Image img = Image.open("test.jpg") img.save("test.png") img.show()