You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I posted this in discussion, but maybe it is more appropriate here:
I have been working with some starter code and have run into a snag.
I am using Image.open() to import one of the example images (cat.jpg in this case). Instead I get FileNotFoundError: [Errno 2] No such file or directory: 'cat.jpg'
Opening an image with Pillow works the same as opening a file with basic Python. If you give an absolute path it will try to load an image from the file at that path; if you give a relative path it will try to load an image from the file at the relative location to your current location.
I posted this in discussion, but maybe it is more appropriate here:
I have been working with some starter code and have run into a snag.
I am using Image.open() to import one of the example images (cat.jpg in this case). Instead I get FileNotFoundError: [Errno 2] No such file or directory: 'cat.jpg'
I dug into a different example I found online, and theirs gave a path to the image: Image.open('data/src/lena.jpg'). Running that gives the same error. In this case, yes, I found src (https://github.com/python-pillow/Pillow/tree/main/src), but that doesn't contain any images. I did find some in https://github.com/python-pillow/Pillow/blob/main/Tests/images/. Is this the new path we should be using? EDIT: trying Image.open("Tests/images/hopper.jpg") gives the same error.
The text was updated successfully, but these errors were encountered: