Last answered:

27 Apr 2020

Posted on:

13 Apr 2020

0

FileNotFoundError PIL

Hello again,    I'm trying to reproduce what is shown in the course but I can't manage to open the image correctly. I downloaded it, change he name to the proper one and move it to the following folder (anaconda3\lib\site-packages\PIL) I did so because of this error shows, I thought this was the right folder, but it still doesn't work.    So the code is: file_name = 'hillside.jpg'
im = Image.open(file_name)
imshow(im)   and the error:
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-19-10835c69b844> in <module>
      1 file_name = 'hillside.jpg'
----> 2 im = Image.open(file_name)
      3 imshow(im)

~\anaconda3\lib\site-packages\PIL\Image.py in open(fp, mode)
   2807 
   2808     if filename:
-> 2809         fp = builtins.open(filename, "rb")
   2810         exclusive_fp = True
   2811 

FileNotFoundError: [Errno 2] No such file or directory: 'hillside.jpg'
  Could you please help me? Thanks!
1 answers ( 0 marked as helpful)
Posted on:

27 Apr 2020

0
This error states that there is no file named "Hillside" on your pc. To correct it please write down or copy paste the path of an image from your computer and replace hillside with same.

Submit an answer