Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I used py2exe for a PyQt4 project at work but ended up switching to <a href="http://www.pyinstaller.org" rel="nofollow" title="PyInstaller">PyInstaller</a>.</p> <p>py2exe worked great for the most part. I remember having to manually tell it to include the sip libraries in my setup.py file along with some others depending on the program. PyInstaller seems to handle this better in my opinion, although I often find myself <em>removing</em> DLL files from the final folders' qt4_plugins folder that it has decided to include that I don't actually need. For example, qt4_plugins\imageformats\qjpeg4.dll when I'm not using JPEG files at all. This does not hinder the frozen application in any way, it'll just increases the filesize.</p> <p>The <a href="http://www.pyinstaller.org/export/latest/tags/1.4/doc/Manual.html?format=raw" rel="nofollow" title="PyInstaller Manual">manual</a> for PyInstaller is pretty good as well and with it's 'Getting Started' section you should quickly be able to get things set up. It's as simple as creating a .spec file per project which is automatically generated but is also a normal Python file so that you have the option to tweak it or add any extra tasks such as code signing or maybe creating a setup.exe program using NSIS.</p> <p>I have a windows batch file named pybuild.bat in my path who's contents consist of:</p> <pre><code>python -O c:\python27\pyinstaller-1.5\build.py "%~f1" </code></pre> <p>so that I can easily build a project from the command line by running 'pybuild projectname.spec' on the projects .spec file. I've also added this to the registry's entry for the .spec file so that I can freeze a project quickly from Explorer:</p> <pre><code>Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.SPEC\shell\Freeze\command] @="C:\\Python27\\Scripts\\pybuild.bat \"%1\"" </code></pre> <p>My main reason for switching from py2exe though is that some users complained that the frozen apps would not run on their machines. I kept running into the error:</p> <blockquote> <p>The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem.</p> </blockquote> <p>but only on some machines, usually running Windows XP. I found that getting the user to install the Microsoft Visual C++ 2008 Runtimes made the problem go away.</p> <p>Frozen apps created with PyInstaller didn't have this problem as it seems to package these runtimes into the output folder. If <a href="http://upx.sourceforge.net/" rel="nofollow" title="Ultimate Packer for eXecutables">UPX</a> is available somewhere in your path it will compress your DLL and PYD files as well, resulting in a smaller output folder.</p> <p>Long story short - both py2exe and PyInstaller work fine. I hit a few issues with py2exe when using it and although there may be workarounds for these if you hunt around I found that PyInstaller worked better without any modifications. I've distributed frozen apps from PyInstaller that make use of image and database libraries from PyQt4 as well as a few other third party libraries and haven't hit any problems yet.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload