2

When I import the code from this project: http://frederickvandenbosch.be/?p=1365 and run the code on the Pi, I get this error. I installed the Adafruit_SSD1306 library and it still does it. Any help would be greatly appreciated. The code is on site that I linked to.

If you can't see the photo, the error message says:

ImportError: No module named 'Image'

Running and showing error

  • Did you install PIL with sudo apt-get install python-imaging? Does that resolve the issue? – Aurora0001 Nov 13 '17 at 16:57
  • @Aurora0001 Yes it is installed, also that library doesn't control an OLED display. If you see the code you will understand. Python-imaging is for imaging formats. – Leo Nov 13 '17 at 17:19
  • Unfortunately I can't see the full code (you only included a small snippet of the code showing the imports, and if I remember correctly, Image comes from PIL, and that's the module that isn't found). It might be best to check with the script author on which library they meant by import Image. – Aurora0001 Nov 13 '17 at 18:02
  • 1
    @Aurora0001 I fixed it by changing "import Image" to "from PIL import Image" and it now works. Thanks for the help with the PIL stuff. – Leo Nov 13 '17 at 18:07
3

I changed import Image to from PIL import Image and it now works.

| improve this answer | |
  • This way doesn't work as well... Python 3.6. – Kirby Feb 19 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.