2017-02-14 1 views
2

저는 Python을 처음 사용합니다. cx_freeze로 실행 파일을 만들려고하는데 파일을 만든 후에 exe를 시작할 수 없습니다. setup.pycx Freeze 실행 파일이 없습니다. import import _tkinter #이 코드가 실패하면 python이 tk 용으로 구성되지 않을 수도 있습니다.

import sys 
 
import os 
 
os.environ['TCL_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tcl8.6" 
 
os.environ['TK_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tk8.6" 
 
from cx_Freeze import setup, Executable 
 
# replaces commandline arg 'build' 
 
sys.argv.append("build") 
 
# change the filename to your program file ---> 
 
filename = "SolutionGenerator.py" 
 
base = None 
 
if sys.platform == "win32": 
 
    base = "Win32GUI" 
 
setup(
 
    name = "Circle", 
 
    version = "1.0", 
 
    description = "cx_Freeze Tkinter script", 
 
    executables = [Executable(filename, base=base)])

3.6.0

코드 pytone 내가 사용하고 Error message

: 나는 다음과 같은 오류를 얻고있다

import sys import os os.environ['TCL_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tcl8.6" os.environ['TK_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tk8.6" from cx_Freeze import setup, Executable "SolutionGenerator.py" base = None if sys.platform == "win32": 
 
    base = "Win32GUI" setup(
 
    name = "Circle", 
 
    version = "1.0", 
 
    description = "cx_Freeze Tkinter script", 
 
    executables = [Executable(filename, base=base)])
17,451,515,나는 내가 인터넷에있는 모든 노력을하지만,이 exe 인 작업을 얻을 수 없습니다. Python 3.6에서 py에서 exe를 만들 수있는 다른 방법이 있습니까?

+0

죄송합니다. 나는 초기 게시물에서 실수를했습니다. 코드는 실제로 : Tkinter를 가져 오기에서 * 수입 임의 메시지 = Tkinter를 가져 오기 메시지 박스에서 [ '! рекриейтни там нещо'] # 응답 = (메시지 [random.randint (0, 렌 (메시지) - 1)]) 최고 = TK에() top.title ("임의의 헛소리 창") top.geometry ("200x180") 데프 helloCallBack() : MSG = messagebox.showinfo (! "샷"(메시지 (상단, 텍스트 = "지금 쐈어!", command = helloCallBack) B.config (높이 = 3, 너비 = 0, len (메시지) - 1)])) B = 15) B.place (x = 50, y = 50) top.mainloop() – Val

+0

이 솔루션을 사용해 보셨습니까? - https://stackoverflow.com/a/42357202/7046074 –

답변

0

나는 정확히 같은 문제를 가지고 있었고, EXE 디렉토리에 수동으로 다음 DLL을 복사하여 그것을 해결 :

  • 퍼센트 PYTHON % \ DLL을 \ tcl86t.dll
  • 퍼센트의 PYTHON % \ DLL을 \ tk86t. dll
관련 문제