3

I'm using imread() from the matplotlib.pyplot library because I want to plot my scatter plots on top of an image:

import matplotlib.pyplot as plt
import logging

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
model_image = plt.imread('data/img1.jpg')

Everything works fine. However, when I use the logger of the standard python lib, it prints a DEBUG error:

DEBUG:PIL.Image:Error closing: 'NoneType' object has no attribute 'close'

This bothers me. Am I doing something wrong, our is it matplotlib fault?

FYI matplotlib version: 2.1.0

tuuttuut
  • 477
  • 7
  • 21
  • Should I use `PIL` directly or use `pillow` instead? – tuuttuut Dec 19 '17 at 17:49
  • You may use anything you like. I'm currently not sure where this "Error" comes from (whether it is on the matplotlib side or the pil(low) side) but it is nothing to worry about too much. `imread` in itself works fine. – ImportanceOfBeingErnest Dec 19 '17 at 17:54
  • Is this something I should report as issue? – tuuttuut Dec 19 '17 at 18:21
  • Because it does not prevent the use of the function, it's not that you "should" report it. You may however still do it, if you feel like it. As said, I'm not sure if this is on the matplotlib side or PIL side, so I wouldn't know *where* to report it actually ;-) – ImportanceOfBeingErnest Dec 19 '17 at 18:24
  • Yes, I will do that of course. Thanks! :) I will try to hide the error for now by suppressing the logs of the PIL module. – tuuttuut Dec 19 '17 at 19:42
  • `pillow` is a fork of `PIL`, which seems to be no longer under active development. – Joe Dec 19 '17 at 20:18
  • see https://stackoverflow.com/questions/12413649/python-image-library-attributeerror-nonetype-object-has-no-attribute-xxx and there also seems to be a bug report https://github.com/python-pillow/Pillow/issues/1144 – Joe Dec 19 '17 at 20:26

0 Answers0