1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Pygame image FilenotFoundError no such file or directory on Mac OS [duplicate]

Discussão em 'Python' iniciado por Stack, Outubro 3, 2024 às 15:12.

  1. Stack

    Stack Membro Participativo

    So im making a game in Pygame using pycharm and every time I try to load the image it says "FileNotFoundError: No file 'Cloud.png' found in working directory '/Users/lendimaxhuni/PycharmProjects/pythonProject'" and I have tried to redirect the download location on safari ( I'm on MacOS) to the pythonProject folder but it still does not work and I'm desperate for help at this point. NOTE: I'M ON MAC OS and for additional info I am using Pycharm. here is my code:

    import pygame
    from sys import exit

    pygame.init()

    screen = pygame.display.set_mode((800,400))
    pygame.display.set_caption('Speed/Runner')
    clock = pygame.time.Clock()

    surface = pygame.image.load("Cloud.png").convert()

    while True:
    for event in pygame.event.get():
    if event.type == pygame.QUIT:
    pygame.quit()
    exit()

    screen.blit(surface,(200,100))

    pygame.display.update()
    clock.tick(60)

    Continue reading...

Compartilhe esta Página