Python Forum
[NEW TO PYTHON] errno 2 "no such file or directory"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[NEW TO PYTHON] errno 2 "no such file or directory"
#1
Hi, sorry, it turns out that the error was caused by the compiler I was using at the time. I tried it on a separate compiler and it worked fine. Thanks!





Hi, my name's Arcaic_, i'm a Y9 Student and i'm new to Python. I'm trying to make a GUI display an image, but i keep getting the following error:

Error:
*** GUIZERO ERROR *** Image import error - '[Errno 2] No such file or directory: 'tabitha.png'' Check the file path and image type is GIF/Animated GIF/BMP/ICO/PNG/JPG/TIF
I've searched this error and every other forum or site that displays it has a solution that's way beyond my depth, and I don't understand the solution or program. Here's my code:

from guizero import App, Text, Picture

app = App("cat")
app.bg = "#FBFBD0"

wanted_text = Text(app, "this is a cat")
wanted_text.text_size = 50
wanted_text.font = "Times New Roman"

cat = Picture(app, image="tabitha.png")

app.display()
Any help I could receive on this would be really appreciated; thank you! (it may be worth mentioning that i'm programming on Raspbian.)
Larz60+ write Dec-31-2020, 09:52 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button

Added for you this time. Please use code tags on future posts.
Reply
#2
the image "tabitha.png" should be in the folder in which the script is located, or you must use the full path
Reply
#3
(Dec-31-2020, 08:50 AM)Axel_Erfurt Wrote: the image "tabitha.png" should be in the folder in which the script is located, or you must use the full path

This works, thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  which PyPI to use for file and directory operations? jollydragon 2 2,747 Jun-14-2018, 05:06 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020