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
'Program > Python' 카테고리의 다른 글
numpy 배열 쪼개기 (0) | 2018.01.05 |
---|---|
2. python3 py파일 exe 실행파일 만들기 (0) | 2017.12.31 |
np.newaxis (0) | 2017.12.28 |
python matplotlib 한글깨짐 (0) | 2017.12.28 |
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 0: invalid start byte (0) | 2017.12.18 |