@@ -8,42 +8,100 @@ Many applications you use every day do this:
8
8
9
9
- Dropbox
10
10
- BitTorrent
11
- -
12
-
11
+ - ...
13
12
14
13
.. todo :: Fill in "Freezing Your Code" stub
15
14
15
+
16
+
17
+ Comparison
18
+ ----------
19
+
20
+ Solutions and platforms/features supported:
21
+
22
+ =========== ======= ===== ==== ======== ======= ============= ============== ==== =====================
23
+ Solution Windows Linux OS X Python 3 Licence One-file mode Zipfile import Eggs pkg_resources support
24
+ =========== ======= ===== ==== ======== ======= ============= ============== ==== =====================
25
+ bbFreeze yes yes yes no MIT no yes yes yes
26
+ py2exe yes no no no MIT yes yes no no
27
+ pyInstaller yes yes yes no GPL yes no yes no
28
+ cx_Freeze yes yes yes yes PSF no yes yes no
29
+ =========== ======= ===== ==== ======== ======= ============= ============== ==== =====================
30
+
31
+ .. todo :: Add other solutions: py2app
32
+
33
+ .. note ::
34
+ Freezing Python code on Linux into a Windows executable was only once
35
+ supported in PyInstaller, `but later dropped
36
+ <http://stackoverflow.com/questions/2950971/cross-compiling-a-python-script-on-linux-into-a-windows-executable#comment11890276_2951046> `_.
37
+
38
+ .. note ::
39
+ All solutions need MS Visual C++ dll to be installed on target machine.
40
+ Only Pyinstaller makes self-executable exe that bundles the dll when
41
+ passing ``--onefile `` to `Configure.py `.
42
+
16
43
Windows
17
- :::::::
44
+ -------
45
+
46
+ bbFreeze
47
+ ~~~~~~~~
48
+
49
+ Prerequisite is to install :ref: `Python, Distribute and pywin32 dependency on Windows <install-windows >`.
18
50
51
+ .. todo :: Write steps for most basic .exe
19
52
20
53
py2exe
21
- ------
54
+ ~~~~~~
22
55
56
+ Prerequisite is to install :ref: `Python on Windows <install-windows >`.
23
57
58
+ 1. Download and install http://sourceforge.net/projects/py2exe/files/py2exe/
24
59
25
- OSX
26
- :::
60
+ 2. Write setup.py (`List of configuration options <http://www.py2exe.org/index.cgi/ListOfOptions >`_)::
27
61
62
+ from distutils.core import setup
63
+ import py2exe
28
64
29
- py2app
30
- ------
65
+ setup(
66
+ windows=[{'script': 'foobar.py'}],
67
+ )
68
+
69
+ 3. (Optionally) `include icon <http://www.py2exe.org/index.cgi/CustomIcons >`_
31
70
71
+ 4. (Optionally) `one-file mode <http://stackoverflow.com/questions/112698/py2exe-generate-single-executable-file#113014 >`_
32
72
73
+ 5. Generate `.exe ` into `dist ` directory::
33
74
75
+ $ python setup.py py2exe
76
+
77
+ 6. Provide the Microsoft Visual C runtime DLL. Two options: `globally install dll on target machine <https://www.microsoft.com/en-us/download/details.aspx?id=29 >`_ or `distribute dll aloneside with .exe <http://www.py2exe.org/index.cgi/Tutorial#Step52 >`_.
34
78
35
79
PyInstaller
36
- -----------
80
+ ~~~~~~~~~~~
81
+
82
+ Prerequisite is to have installed :ref: `Python, Distribute and pywin32 dependency on Windows <install-windows >`.
83
+
84
+ - `Most basic tutorial <http://bojan-komazec.blogspot.com/2011/08/how-to-create-windows-executable-from.html >`_
85
+ - `Manual <http://www.pyinstaller.org/export/d3398dd79b68901ae1edd761f3fe0f4ff19cfb1a/project/doc/Manual.html?format=raw >`_
37
86
38
87
88
+ OSX
89
+ ---
90
+
91
+
92
+ py2app
93
+ ~~~~~~
94
+
95
+ PyInstaller
96
+ ~~~~~~~~~~~
39
97
40
98
41
99
Linux
42
- :::::
100
+ -----
43
101
44
102
45
103
bbFreeze
46
- --------
104
+ ~~~~~~~~
47
105
48
106
PyInstaller
49
- -----------
107
+ ~~~~~~~~~~~
0 commit comments