Pure: pure python modules needed by the scripts Scripts: the python scripts named on the command line The resulting object (assigned to a) contains lists of dependencies
It analyzes all imports and other dependencies. The statements in a spec file create instances of four classes,Ī new instance of class Analysis takes a list of script names as input. zipped_data, cipher = block_cipher ) exe = EXE ( pyz. You create a spec file using this command:īlock_cipher = None a = Analysis (, pathex =, binaries = None, datas = None, hiddenimports =, hookspath = None, runtime_hooks = None, excludes = None, cipher = block_cipher ) pyz = PYZ ( a. When you want to create a multiprogram bundle with merged common modules. When you want to add Python run-time options to the executable. PyInstaller does not know about from any other source. When you want to include run-time libraries (. When you want to bundle data files with the app. There are four cases where it is useful to modify the spec file: Give all the needed information (such as hidden imports)Īs options to the pyinstaller command and let it run. PyInstaller builds the app by executing the contents of the spec file.įor many uses of PyInstaller you do not need to examine or modify the spec file. The spec file is actually executable Python code. It encodes the script names and most of the options
The spec file tells PyInstaller how to process your script. That file is stored in the -specpath directory, The first thing PyInstaller does is to build a spec (specification) file