wiki:FAQ

Version 20 (modified by htgoebel, 20 months ago) (diff)

--

Features

  1. Can I use PyInstaller as a cross-compiler?
    1. Can I package Windows binaries while running under Linux?
      No, this is not supported. Please use Wine for this, PyInstaller runs fine in Wine. You may also want to have a look at this thread in the mailinglist. In version 1.4 we had build in some support for this, but it showed to work only half. It would require some Windows system on another partition and would only work for pure Python programs. As soon as you want a decent GUI (gtk, qt, wx), you would need to install Windows libraries anyhow. So it's much easier to just use Wine.
    2. Can I package OS X binaries while running under Linux?
      This is currently not possible at all. Sorry! If you want to help out, you are very welcome.
  2. Does PyInstaller build a real installer like NSIS or InstallShield?
    No, despite its name (which has more to do with its historical roots), PyInstaller is used to transform a Python program into a native executable form which does not require existing Python installations to run. Building an installer program is totally outside the scope of PyInstaller.

If Things Go Wrong

  1. PyInstaller crashed when packaging my program
    This looks like a bug. Please have a look at HowtoReportBugs, which will help us a lot on solving the problem.
  2. I get an ImportError when running the packaged version. What should I do?
    Please make sure, all modules required by you application are packaged. See How to Report Bugs for more information.
  3. My program crashes when running the packaged version. What should I do?
    Please make sure, all data files required by you application are packaged. See How to Report Bugs for more information.
  4. I made it work by implementing a hook. Do you want it?
    Yes, we'll happily integrate any hook which may be of interest for others. Please open a ticket and attach the hook.

License

  1. Can I use PyInstaller for my commercial, closed-source, Python application?
    Yes.
  2. If I use PyInstaller for my commercial Python application, will I have to distribute my source code as well?
    Absolutely not. You can ship the executables created with PyInstaller with whatever license you want.
  3. I need to modify PyInstaller for my own needs. Can I do that?
    Of course, PyInstaller is free software. This falls under the terms of the GPL license: you can modify PyInstaller as you wish, but if you distribute your modifications (so-called derived work), you will have to do that under the GPL license. In short, you can't change the license of PyInstaller.
  4. Can I modify PyInstaller, use it for a commercial product, and never release nor distribute my modified version of PyInstaller?
    Depends. PyInstaller source code is logically divided into two parts: one part is the builder itself, which constructs the executable. The other is the bootloader, which is embedded within the final executable. If you modify only the builder, then the answer is yes. If you modify also the bootloader, the answer is no: in fact, by distributing the final product you are also distributing a binary version of the bootloader, so you are forced to release the source code for your modified version.
    • How can I tell the bootloader from the builder?
      Just read the license at the top of each file. If it contains a paragraph with a special exception, then the file is part of the bootloader. Otherwise, it is part of the builder.
    • This is too hard for me. I want a simpler rule.
      Always contribute your modifications back to us. This is easier to remember, and it is also a nice way to show that you appreciated our program. We will do our best to integrate your patches into PyInstaller!

Misc

  1. With PyInstaller, I don't get Windows XP themes in my application with wxPython!
    Make sure you are using at least PyInstaller 1.3, and that you are building a windowed mode executable (pass -w to Makespec.py).
  2. What about .egg files?
    PyInstaller trunk fully supports .egg files: they are bundled as-is. In one-dir mode, you will see them on the filesystem; in one-file mode, they will be unpacked within the temporary directory along with dynamic libraries. This is actually a workaround, but it is better than nothing, and makes sure that all .egg features (eg: entry points, pkg_resources, etc.) work correctly. Notice that PyInstaller does inspect .egg files at build-time and correctly looks for dependencies they have.
  3. What about pkg_resources?
    pkg_resources is currently not supported by PyInstaller. This means that an application using a library which uses the the pkg_resources API will probably not work out of the box. The only situation in which it works is when it's being used on .egg files (see above).
  4. Under Linux, I get runtime dynamic linker errors, related to libc. What should I do?
    The executable that PyInstaller builds is not fully static, in that it still depends on the system libc. Under Linux, the ABI of GLIBC is backward compatible, but not forward compatible. So if you link against a newer GLIBC, you can't run the resulting executable on an older system. The solution is to compile the bootloader on the oldest system you have around, so that it gets linked with the oldest version of GLIBC. Then, you can copy the bootloader binaries (support/loader/*) into your development system and run Build.py there.
  5. Can I use PyInstaller with other Python distributions?
    The primary development and testing of PyInstaller is focused on official Python releases available from Python website. Other Python distributions like ActiveState or Enthought may or may not work. ActiveState might work on Windows (see #351).

Recipes