0
votes

I am using pyinstaller for creating one executable file for my pipenv project on OS X. I run pipenv run pyinstaller --onefile myscript.py which results in 3 things- build/, dist/ and myscript.spec. I have a config file for my project and to add that to this bundle, I run- pipenv run pyinstaller --onefile --add-data 'config.json:.' myscript.py which gets added to myscript.spec. I want to understand 2 things-

  1. According to docs, I need to give users the executable file in my dist/ folder.They'll execute it without any dependencies on anything else?

  2. Do I need to give my config.json file to every user as well? As I understand, we are adding a path for the config file in our specs.

1

1 Answers

0
votes

The --onefile flag creates a single portable file.

Your assumption in (1.) is correct; you will not have to give your users the config file, as the file is extracted from the .exe at runtime, so long as it was included correctly.

To clarify, the bootloader creates a temporary folder in the temp-folder directory in Windows, into which it will extract your .config file along with everything else it requires, and run from there. This is described well at this link: https://pythonhosted.org/PyInstaller/operating-mode.html