0
私はPythonスクリプトから実行ファイルを作成しようとしています。私はWindows 7、cx_freeze 5.0.2、Python 3.6を使用しています。cx_freeze Tkinter 'モジュールが見つかりません'
私はTkinterのが通常のライブラリに含まれていない、あなたは、次の2行に似た何かを追加する必要があることを知っている:3.6と私の場所にあるため、もちろん除いて
os.environ['TCL_LIBRARY'] = "C:\\Program Files\\Python35\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Program Files\\Python35\\tcl\\tk8.6"
を、しかし、私は」することができますtはアナコンダ3.6
私は
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"]}
# 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 = "McCabe-Thiele",
version = "0.1",
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [Executable("GUI.py", base=base)])
のsetup.pyと呼ばれる次のファイルを作成し、python setup.py bdist_msi
でCMDラインから実行してそのディレクトリを見つけます。
正常にインストールされたdistを正常に作成します。
しかし、私は、次のエラーが発生した.exeファイルを実行すると:
ModuleNotFoundError: no module named 'tkinter'
は、3行目に、この