0

My Python file has been working fine during testing in VSC and also works fine when using IDLE. Unfortunately when I run the file using Python it crashes instantly and gives me the error

FileNotFoundError: No such file or directory.

This is the line of code it gets stuck on if that matters.

clickSound = pygame.mixer.Sound("click.wav")

Thank you for any and all help. I am using Python for Windows if it helps.

David
  • 5
  • 2

1 Answers1

0

It looks like it can't find that file. Try to fix the path to a relative one. Or place "click.wav" in the same directory as your python file you are running using Python.

Damian
  • 78
  • 3
  • Hi, thank you for your answer. All relevant files are in the same folder/directory so I can't imagine that's the issue. Could you clarify what you mean by fixing the path to a relative one please? – David Mar 27 '21 at 12:14