반응형

배경

opencv 를 쓰기 위해 파이썬 코드를 작성해 nodejs 서버에서 실행하고 있었다.

결과

https://github.com/pyinstaller/pyinstaller/issues/2613

 

How to generate an executable on Linux for Windows? · Issue #2613 · pyinstaller/pyinstaller

I'm trying to generate an executable from Linux for Windows. pyinstaller --onefile --windowed montecarlo.py I run this command and get a single executable that works on Linux just fine, I can open ...

github.com

 

하지만 조사결과 그렇게하지 못한다고 한다.

Pyinstaller 메뉴얼을 보면 다음과 같은 글이있다.

PyInstaller is tested against Windows, Mac OS X, and Linux. However, it is not a cross-compiler: to make a Windows app you run PyInstaller in Windows; to make a Linux app you run it in Linux, etc. PyInstaller has been used successfully with AIX, Solaris, and FreeBSD, but is not tested against them.

according to the comments in that answer it appears the ability to cross-compile was removed in 1.5, which was many releases ago. However, the secondary answer mentioning wine is correct -- you can usually create working Windows executables if you run pyinstaller under wine.

And as @xoviat mentioned, pyinstaller is cross-platform -- the compilation program works on Linux, OSX, and Windows. However, the resulting executables are platform specific.

 

한마디로 cross-compiler 가 아니라 불가능하다는 것이다. Wine 을 쓰는걸 추천한고 한다.

 

그리고, pyinstaller 는 사용자의 OS 환경에 맞게 실행파일을 만들어준다. linux 에서 배포를 했으면 조금은 달라졌을까?

왠만하면 언어 하나만을 쓰는걸로 생각하는게 정신건강에 좋을 듯 하다.

반응형

'Error' 카테고리의 다른 글

[React] useEffect 함수 한 번만 실행되게 하기  (0) 2023.06.02

+ Recent posts