Skip to content

How to compile

AlessandroZ edited this page Dec 20, 2016 · 10 revisions

Using pyinstaller

For Windows only

  • To get a better compatibility between systems, msvcp100.dll and msvcp100.dll could be added. These files could be found in "C:\Windows\System32". Place it on the root folder of the pyinstaller directory.

  • Create a .spec file adding all options wanted. Mine is as follow:

# -*- mode: python -*-
import sys
a = Analysis(['..\LaZagne\Windows\laZagne.py'],
             pathex=[''],
             hiddenimports=[],
             hookspath=None,
             runtime_hooks=None)
for d in a.datas:
  if 'pyconfig' in d[0]: 
    a.datas.remove(d)
    break
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
		  a.binaries + [('msvcp100.dll', 'msvcp100.dll', 'BINARY'),
						('msvcr90.dll', 'msvcr90.dll', 'BINARY')]
		  if sys.platform == 'win32' else a.binaries,
          a.zipfiles,
          a.datas,
          name='laZagne.exe',
          debug=False,
          strip=None,
          upx=True,
          console=True )

  • Generate your executable file: python pyinstaller.py --onefile lazagne.spec
Clone this wiki locally