Hi,

Firstly I suggest to use --onedir (the default) instead of --onefile to 
debug then switch back to --onefile once it’s working. --onefile does 
everything --onedir does but hidden in a temporary directory so you can’t 
see anything that’s happening. With --onedir mode, you’ll be able to 
navigate into the dist folder and check if/where your files have been 
included.

I’m assuming your project structure is as follows. Correct me if it’s 
different:

+-- game.py
+-- images
|    +-- image1.png
|    +-- image2.jpg
+-- sounds
|    +-- noise1.wav

And your shell/cmd prompt is in running in the same folder as game.py.

Secondly, as you’re a beginner I want to be sure you know how to use 
external files portably in regular non-PyInstaller Python without making 
any assumptions about the current working directory. Something like this 
<https://stackoverflow.com/a/36906785> is the usual method. Test yours by cd 
ing to a different folder, then running python /full/path/to/game.py. If it 
works then you’re ready to start using PyInstaller.

Your guess pyinstaller --add-data "img/";"img" game.py is the correct 
syntax and it should work. The *DEST* is where inside your application it 
to go relative to the app's root (this will make more sense once you’ve 
used the --onedir option). The quotes are unneeded unless you have names 
with spaces and you have to use : instead of ; on macOS. 

Let us know if you're still getting stuck,

Brénainn

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/384f8702-1f02-49f9-95ca-4ba5e862c5cfn%40googlegroups.com.

Reply via email to