-3

I used pyinstaller to compile my pygame code into an exe file using this command: pyinstaller --onefile -w gamename.py But after moving it to a different directory and running it, it gives me file not found errors and file doesn't exist errors. ALL help is greatly appreciated. Thanks.

Ink Shade
  • 17
  • 2
  • 2
    "it gives me file not found errors and file doesn't exist errors"—please show us the _full, exact error messages_. Describing them in your own words is not enough. We need details. Please read [ask]. – ChrisGPT was on strike Feb 11 '22 at 01:42
  • Please read [ask]. In particular: "**Post the question and respond to feedback** After you post, leave the question open in your browser for a bit, and see if anyone comments. If you missed an obvious piece of information, be ready to respond by editing your question to include it. If someone posts an answer, be ready to try it out and provide feedback!" – ChrisGPT was on strike Feb 12 '22 at 16:25

1 Answers1

1

Possibly, you have some file locations in your code as strings. These external files are not part of your code, so they are not compiled into exe.

Check this answer about adding files in pyinstaller

vladko312
  • 99
  • 6
  • This is a wild guess, not an answer. Please read [answer]. – ChrisGPT was on strike Feb 11 '22 at 01:45
  • Sorry, i am new here. I agree that my answer is still a guess, but it is a reasonable one. At least, the possibility of external files not being included should be checked in such cases, as it is a common mistake. – vladko312 Feb 11 '22 at 02:00