|
1 | | -Instructions for building the Windows executable using PyInstaller 2.1: |
| 1 | +Instructions for building the Windows executable using PyInstaller 3.2.1 on Python 2.7.10 |
2 | 2 |
|
3 | | -Note: As of April 2016 PyInstaller 3.0 does not work properly |
4 | | - |
5 | | -1. Make sure PyInstaller 2.1 is installed in your Python environment! |
| 3 | +1. Make sure PyInstaller 3.2.1 is installed in your Python environment! |
6 | 4 |
|
7 | 5 | 2. Open the file build_exe.py and adjust the directories if required. |
8 | 6 |
|
9 | | -3. Extremely important: Make sure that in main.py the line |
10 | | - sip.setapi('QVariant', 2) |
11 | | - is commented out: |
12 | | - #sip.setapi('QVariant', 2) |
13 | | - |
14 | | -4. In your python installation locate the directory in which the |
| 7 | +3. In your python installation locate the directory in which the |
15 | 8 | mpl_toolkits reside. Put an empty file named __init__.py into it |
16 | 9 | (e.g. c:\Progs32\WinPython-32bit-2.7.10.3\python-2.7.10\Lib\site-packages\mpl_toolkits\__init__.py) |
17 | 10 |
|
| 11 | + |
| 12 | +4. In your python installation locate file build_main.py in the PyInstaller\building directory |
| 13 | + (e.g. C:\Progs32\WinPython-32bit-2.7.10.3\python-2.7.10\Lib\site-packages\PyInstaller\building\build_main.py) |
| 14 | + Open this file and go to the function "build(spec, distpath, workpath, clean_build)". Insert the line |
| 15 | + |
| 16 | + sys.setrecursionlimit(2147483647) |
| 17 | + |
| 18 | + just below the imports. Save the file. (This is to fix a bug on PyInstaller / modulegraph, see |
| 19 | + comment in PyInstaller\lib\modulegraph\modulegraph.py: |
| 20 | + #FIXME: To decrease the likelihood of ModuleGraph exceeding the recursion limit |
| 21 | + #and hence unpredictably raising fatal exceptions, increase the recursion |
| 22 | + #limit at PyInstaller startup (i.e., in the |
| 23 | + #PyInstaller.building.build_main.build() function). For details, see: |
| 24 | + # https://github.com/pyinstaller/pyinstaller/issues/1919#issuecomment-216016176 ) |
| 25 | + |
18 | 26 | 5. Make sure that build_dir is not opened in any application or console, i.e., |
19 | 27 | it can be deleted by the script. |
20 | 28 |
|
21 | 29 | 6. Run build_exe.py |
22 | 30 |
|
23 | | -7. The resulting exe should be found in build_dir. |
| 31 | +7. The resulting exe should be found in build_dir\PyPlane. |
24 | 32 |
|
25 | 33 | 8. If some modules are not found after launching the exe you have to manually |
26 | 34 | import them using the --hidden-import option in build_exe. This can be |
27 | 35 | a time-consuming trial and error procedure. |
28 | 36 |
|
29 | | -9. Change the line |
30 | | - #sip.setapi('QVariant', 2) |
31 | | - in main.py to |
32 | | - sip.setapi('QVariant', 2) |
33 | | - to ensure that the application runs properly under native Python. |
| 37 | +9. Open the file InstallerPyPlane.nsi, adjust the version information if required, and run the |
| 38 | + file through NullSoft Installable System. Setup.exe will be placed into build_dir. |
0 commit comments