python - cx_freeze - ошибка внешнего модуля transifex.api

Это мой файл cx_freeze setup.py со всеми необходимыми мне модулями:

import sys
from cx_Freeze import setup, Executable
import os

os.environ['TCL_LIBRARY'] = "C:\\Users\Maicol\AppData\Local\Programs\Python\\Python36\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\Maicol\AppData\Local\Programs\Python\\Python36\\tcl\\tk8.6"

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os",
                                  "numpy",
                                  "tkinter",
                                  "zipfile",
                                  "subprocess",
                                  "time",
                                  "gettext",
                                  "ctypes",
                                  "locale",
                                  "PIL.Image",
                                  "PIL.ImageTk",
                                  "webbrowser",
                                  "feedparser",
                                  "transifex.api",
                                  "polib"],
                     "includes":["transifex.api.requests.packages.core.idnadata"],
                     'include_files':['LICENSE',
                                      "changelog.txt",
                                      "tcl86t.dll",
                                      "sld_icon_beta.ico",
                                      "tk86t.dll",
                                      "images",
                                      "icons",
                                      "locale"],
                     "include_msvcr": True
                     }

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(  name = "School Life Diary",
        version = "0.3",
        author="maicol07",
        description = "Diario scolastico sempre con te!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("main.py",
                                  base=base,
                                  icon="sld_icon_beta.ico",
                                  shortcutName="School Life Diary",
                                  shortcutDir="DesktopFolder"),
                       Executable("settings.py"),
                       Executable("subjects.py"),
                       Executable("timetable.py")])

Когда я собираю exe и запускаю основной файл.exe, я получаю эту ошибку:

ошибка cx_freeze Если вам нужен любой другой код, просто спросите меня! (См. Также предыдущие сообщения для некоторых фрагментов) Спасибо

1 ответ

Решение

Решил сам, удалив includes список и добавление "idna" в packages список.

Код:

import sys
from cx_Freeze import setup, Executable
import os

os.environ['TCL_LIBRARY'] = "C:\\Users\Maicol\AppData\Local\Programs\Python\\Python36\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\Maicol\AppData\Local\Programs\Python\\Python36\\tcl\\tk8.6"

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os",
                                  "numpy",
                                  "tkinter",
                                  "zipfile",
                                  "subprocess",
                                  "time",
                                  "gettext",
                                  "ctypes",
                                  "locale",
                                  "PIL.Image",
                                  "PIL.ImageTk",
                                  "webbrowser",
                                  "feedparser",
                                  "requests",
                                  "idna",
                                  "transifex.api",
                                  "polib",
                                  ],
                     #"includes":["transifex.api.requests.packages.core.idnadata"],
                     'include_files':['LICENSE',
                                      "changelog.txt",
                                      "tcl86t.dll",
                                      "sld_icon_beta.ico",
                                      "tk86t.dll",
                                      "images",
                                      "icons",
                                      "locale"],
                     "include_msvcr": True
                     }

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(  name = "School Life Diary",
        version = "0.3",
        author="maicol07",
        description = "Diario scolastico sempre con te!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("main.py",
                                  base=base,
                                  icon="sld_icon_beta.ico",
                                  shortcutName="School Life Diary",
                                  shortcutDir="DesktopFolder"),
                       Executable("note.py"),
                       Executable("settings.py"),
                       Executable("subjects.py"),
                       Executable("timetable.py")])
Другие вопросы по тегам