Last answered:

08 Jul 2022

Posted on:

26 May 2022

0

Can't open/read file at Visual Studio

I'm having the following problem to read the .png file, where do i need to save it?

image.png

3 answers ( 0 marked as helpful)
Instructor
Posted on:

31 May 2022

0

Hey Lucas,

Thank you for your question!

Please, make sure that the 'capstone_coins.png' file exists in the same folder as your Python script, namely 'capstone_solution.py'.

Let me know if the problem persists.

Kind regards,
365 Hristina

Posted on:

07 Jul 2022

0

I have the same problem. I already have capstone_solution.py and capstone_coins.png in the same folder, but when I run the code it gives me that error and the image doesn't open.

Instructor
Posted on:

08 Jul 2022

0

Hey Alessandro,

Thank you for your comment!

Please, make sure that:
1. you are working in the capstone environment you have created;
2. the imread() functions on lines 4 and 5 (referring to the code above) take in as a first argument the full name of the image, exactly as it is named in the folder;
3. double check the image is indeed in the same folder as your python script .

Note: I have run the code from the screenshot above using PyCharm and the image appears as expected. There should be no issue with Visual Studio, or any other IDE.

Let me know if the problem persist and, if it does, please attach a screenshot of the code, the error message, and possibly the content of the folder you are working in, namely:

image.png

Kind regards,
365 Hristina

Submit an answer