Can't open Image on mac with PIL

前端 未结 1 683
一整个雨季
一整个雨季 2021-01-23 10:47

So I have a short python script that takes in a base64 string that represents an image, and then opens a preview of that image.

Heres my script:

#!/usr/         


        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-23 11:03

    After digging a bit more, it seems this error from FSPathMakeRef means that the file was not found. So I looked inside my applications folder, and Preview was right there!

    When i clicked get info i noticed it was in the /System/Applications/ folder and not in /Applications, so it seems PIL is referencing the wrong location.

    My guess is that the application was moved in Catalina and PIL just hasn't been updated yet.

    Anyway to fix it I just made a symbolic link where PIL was looking like this:

    ln -s /System/Applications/Preview.app /Applications/Preview.app
    

    and it worked like a charm!

    0 讨论(0)
提交回复
热议问题