개발일기/파이썬(Python)
python 바이너리 배포파일 만드는 법
프로그래머콩
2019. 1. 9. 16:31
OS, Python 및 기타 환경
- OS : Ubuntu16.xx, Mac10.xx
- Python : 3.xx
- 사용 라이브러리 : openpyxl, pymysql
- 사용 배포 라이브러리 : cx_freeze, pyinstaller
ubuntu
1. python3 설치, 사용 라이브러리도 설치(그래야 라이브러리가 함께 묶임)
2. cx_freeze 설치 ( pip로 설치했음. $pip install cx_freeze)
3. 배포파일 만들기
$cx_freeze test.py
mac
1. python3 설치, 사용 라이브러리도 설치
2. pip로 pyinstaller설치
3. $pyinstaller test_insert.py -n mac_insert --workpath mac -F --onefile -d imports
-n mac_insert : 이름은 'mac_insert'
--workpath mac : path 'mac'이다
-F --onefile : 구질구질한 것들 생략하고 하나 파일로 묶겠다
++
위 pyinstaller명령어는 실패했고 이유는 -F와 --onefile이 같은 의미라서 그런듯
실제로 사용해서 성공했던 명령어
$pyinstaller test_insert.py -F -w
끝