2017-10-12 14 views
0

あるtransifex.api外部モジュールに関するエラー:のpython - cx_freeze - これは私が必要とするすべてのモジュールで、私の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ファイルのIを実行すると、このエラーが発生する:

cx_freeze error 他のコードが必要な場合は、私に相談してください! おかげで自分がincludesリストを削除し、packagesリストに"idna"を追加することで解決

答えて

0

を(いくつかのスニペットのためにも、以前の記事を参照してください)。

コード:

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")]) 
関連する問題