close

Pyinstaller works fine in Python 3.5 (e.g. pyinstall report.py)
whereas in Python 3.6.2 it ran into problem with the error message:  IndexError: tuple index out of range


To solve the problem, cx_Freeze module needs to be installed and setup as follows:

1. pip install cx_freeze
2. Create a setup.py script containing the following:  (report.py is the name of your own Python script in which you need to compile into executable file (.exe)


import cx_Freeze
exe = [cx_Freeze.Executable("
report.py")]
cx_Freeze.setup( name = "report", version = "1.0", description = "cx_Freeze report", executables = exe )

3. Finally, build the setup.py as follows:
python setup.py build

4. The executable file (report.exe) will be created in the build\exe.win-amd64-3.6\ subdirectory





[Reference]
https://stackoverflow.com/questions/41559171/pyinstaller-and-python3-6-tuple-index

arrow
arrow
    文章標籤
    Python
    全站熱搜

    DanBrother 發表在 痞客邦 留言(0) 人氣()