본문 바로가기
공부,일/파이썬

파이썬 배포하기

by fromnothing1 2022. 11. 14.

파이썬은 .py스크립트라서  python을 깔아야지만 스크립트를 실행 할 수 있다.  라이브러리도 따로 다운 해야한다. 

떄문에 exe 파일로 만들어서 배포 해서 파이썬이 없는 컴퓨터에서도 사용해보자 .

 

 

1. pyinstaller 다운

pip install pyinstaller

2. 생성

pyinstaller --onefile terminal2.py

 

적당히 visual studio에서 python 스크립트 찾은다음 pyinstaller 설치하고 

터미널에서 위 명령어 입력

--onefile 옵션을 줘야지만 input()함수를 사용할 수 있다.

출처:https://stackoverflow.com/questions/69529305/exe-file-created-with-pyinstaller-is-showin-error-input-lost-sys-stdin

 

.exe file created with Pyinstaller is showin error input(): lost sys.stdin

i am using pyinstaller to convert a .py file to .exe file my terminal2.py file is: import sys if __name__ == "__main__": arg = sys.argv name = input("Enter your name.."...

stackoverflow.com

그리고 python.exe 가 환경변수로 있어야지 터미널에서 pyinstaller 사용 가능하다. 

 

https://hoohaha.tistory.com/93

 

[Windows] 환경 변수란? 환경 변수의 모든 것

여러 버전의 파이썬 설치를 하며 환경변수의 중요성에 대해 알게 되었고 공부하며 얻은 정보들을 아래에 정리해둔다. 혹시라도 환경변수가 꼬여서 원하는 명령어가 실행되지 않는 사람들이 보

hoohaha.tistory.com

 

'공부,일 > 파이썬' 카테고리의 다른 글

txt 편집 하는 프로그램  (0) 2023.02.05
판다스 사용해보기(엑셀 사용)  (0) 2023.02.05
colab 환경설정  (0) 2021.11.29
파이썬 엑셀 사용  (0) 2021.11.23
원격으로 jupyter notebook 사용 colab  (0) 2021.11.17

댓글