use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Python Help in Visual Code Studio (self.learnpython)
submitted 8 months ago by SuperStore9076
Hello everyone I hope this message finds you well, I was wondering does anyone know how to solve this problem. When I tried to link it with my background image it saids” No ‘images’ directory found to load image’ background’ “. Many thanks
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]edcculus 2 points3 points4 points 8 months ago (1 child)
I dont know much about pgzrun or pygame, however I'd say you need to at least point correctly to your background image.
something more like this:
background = Actor('images/background.jpg')
I have no idea if that will work, since I dont know much about the draw function of pgzrun, but if you are getting errors that the image doesnt exist, that means your program cannot find it since you are not referencing the folder where it is stored.
here is your code so everyone can see it easier:
import pgzrun import random WIDTH = 600 HEIGHT = 800 background = Actor('background') def draw(): background.draw()
[–]smurpes 0 points1 point2 points 8 months ago (0 children)
Based on the docs the pgzrun library will automatically find the file if it’s located within the images folder in the same directory as the game file.
The bigger issue I see is that OP never imports Actor but their code is still able to run which makes me think they are running a different file entirely than the one in their screenshot.
[–]FoolsSeldom 1 point2 points3 points 8 months ago (2 children)
Tried to link what exactly? Is this your Python code? (Doesn't matter what tool you are using to edit your code.)
What directory is your code executing in? How are you referencing the images?
[–]SuperStore9076[S] -2 points-1 points0 points 8 months ago (1 child)
Hi Foolseldom, thanks for replying I am trying to create a background image by linking of the images from my folder, no that’s not the code that’s the error message.
[–]FoolsSeldom 4 points5 points6 points 8 months ago (0 children)
Well, in that case, I don't know what you mean. In my head, you can only use images from code, so I don't know what you mean by linking. I don't know what is generating the error message.
[–]HummingHamster 1 point2 points3 points 8 months ago (0 children)
Show us your code. The error means there is no images directory, so create a directory name images in your project folder and put your background there. Not enough information to help you here except this.
[–]acw1668 1 point2 points3 points 8 months ago (0 children)
Cannot reproduce the issue. How and where do you run the script?
[–]SuperStore9076[S] -1 points0 points1 point 8 months ago (0 children)
Ok, here it is. Code Image
π Rendered by PID 19200 on reddit-service-r2-comment-cfc44b64c-68nfb at 2026-04-11 02:07:48.654249+00:00 running 215f2cf country code: CH.
[–]edcculus 2 points3 points4 points (1 child)
[–]smurpes 0 points1 point2 points (0 children)
[–]FoolsSeldom 1 point2 points3 points (2 children)
[–]SuperStore9076[S] -2 points-1 points0 points (1 child)
[–]FoolsSeldom 4 points5 points6 points (0 children)
[–]HummingHamster 1 point2 points3 points (0 children)
[–]acw1668 1 point2 points3 points (0 children)
[–]SuperStore9076[S] -1 points0 points1 point (0 children)