반응형

py2exe는 python2 만 지원하는 것으로 알고 있고

python3에는 cx_freeze 라는 모듈을 사용해야한다.


cx_freeze - http://cx-freeze.sourceforge.net

py2exe - http://www.py2exe.org


> pip install cx_freeze


Setup.py 파일로 만들어서 실행 파일로 실행


import sys

import os

from cx_Freeze import setup, Executable


os.environ['TCL_LIBRARY'] = "c:/python/tcl/tcl8.6"

os.environ['TK_LIBRARY'] = "c:/python/tcl/tk8.6"


setup(name = "parser",

options={"build_exe": {"packages": ["tkinter", "matplotlib"],

"include_files": ['clienticon.ico']}},

version = "1.0",

description = "Parser",

author = "head1ton",

executables = [Executable("parser.py")])

만약 윈도우 GUI 프로그램인 경우 executables의 옵션을 입력해주어야 한다.

executables = [Executable("imgtk.py", base="Win32GUI")])


Setup.py 실행

> python setup.py build


설치파일로 만들 수도 있다.

> python setup.py bdist_msi

dist 폴더에 설치파일 생성.


참고 - http://sh1n2.tistory.com/123

반응형

+ Recent posts