'The application /Applications/Preview.app cannot be opened for an unexpected reason
Im developing an algorithm that automatically draws plans for my business using python PIL Image Draw I want to show the image but I get the following error
The application /Applications/Preview.app cannot be opened for an unexpected reason, error=Error Domain=NSCocoaErrorDomain Code=260 "The file “Preview.app” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Applications/Preview.app, NSFilePath=/Applications/Preview.app, NSUnderlyingError=0x600003e4c0f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
This is the code
f = io.BytesIO()
img = Image.new('RGB', (img_x, img_y), '#FFFFFF')
draw = ImageDraw.Draw(img)
...
img.save(f, 'PNG')
img.show()
f.seek(0)
return base64.b64encode(f.read())
I can't change the file format or anything like this since im putting this into a module and I need a base64string for it to work
Im using an 8 core Intel MacBook Pro with macOS Monterey 12.1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
