Python PIL load throwing AttributeError: 'NoneType' object has no attribute 'read'

前端 未结 2 528
太阳男子
太阳男子 2021-01-20 20:59

I\'ve been struggling with this error for several days with little headway. Basically, I\'m trying to read in an image file and then use PIL to preform a specific operation

2条回答
  •  悲哀的现实
    2021-01-20 21:32

    This is a silly thing, but I ran into this same error and spent at least an hour trying to find a solution. However the problem was actually mine, the filename I was passing was blank and caused it to throw this error........ Ugh.. Would have been nice if the library said "oh, you are missing the filename" instead of 'NoneType' object has no attribute 'read'. This was on a raspberry pi and python 2.7 just FYI.

提交回复
热议问题