πŸ‘¨πŸΌβ€πŸ’»κ°œλ°œ/파이썬

파이썬 - μΈν„°ν”„λ¦¬ν„°μ—μ„œ 컴파일둜 속도 μ„±λŠ₯ ν–₯상(Nuitka)

Janger 2025. 4. 10. 14:02
728x90

 

μ„€λͺ…: 

NuitkaλŠ” Python μ½”λ“œλ₯Ό C/C++ μ½”λ“œλ‘œ λ³€ν™˜ν•΄ μ‹€ν–‰ κ°€λŠ₯ν•œ λ°”μ΄λ„ˆλ¦¬ νŒŒμΌμ„ μƒμ„±ν•˜λŠ” Python μ»΄νŒŒμΌλŸ¬μž…λ‹ˆλ‹€. Python μΈν„°ν”„리터 λ°©μ‹μ˜ ν•œκ³„λ₯Ό λ³΄μ™„ν•˜κ³ , μ‹€ν–‰ μ†λ„λ₯Ό ν–₯μƒμ‹œν‚€λ©°, μ½”λ“œλ₯Ό μ΅œμ ν™”ν•˜λŠ” λ° λ„움을 μ€λ‹ˆλ‹€. λ˜ν•œ, Python μ½”λ“œλ₯Ό λ°°ν¬ κ°€λŠ₯ν•œ ν˜•νƒœλ‘œ νŒ¨ν‚€μ§•ν•  μˆ˜ μžˆμ–΄ μ†ŒμŠ€ μ½”λ“œ λ³΄ν˜Έ λ° μ˜μ‘΄μ„± κ΄€λ¦¬λ₯Ό κ°„νŽΈν•˜κ²Œ ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.

 

 

νŒŒμ΄μ¬μ€ μΈν„°ν”„λ¦¬ν„°λ‘œ 처리λ₯Ό ν•˜λ‹€ λ³΄λ‹ˆ λ‹€λ₯Έ λ°”μ΄λ„ˆλ¦¬ νŒŒμΌλ“€μ— λΉ„ν•΄ μ†λ„λ©΄μ—μ„œλŠ” λΆ€μ‘±ν•  수 μžˆλ‹€. 속도가 λΆ€μ‘±ν•˜λ©΄ μ²˜λ¦¬λŸ‰λ„ λ’€λ–¨μ–΄μ§€κ³  κ²°κ΅­ μ„±λŠ₯이 λ’€μ³μ§€κ²Œ λœλ‹€. 

이λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•΄ Nuitkaλ₯Ό μ‚¬μš©ν•΄ 파이썬 νŒŒμΌμ„ μ»΄νŒŒμΌν•˜μ—¬ μ‹€ν–‰ 속도λ₯Ό ν–₯상 μ‹œν‚¬ 수 μžˆλ‹€. 

λŒ€μ‹  컴파일 ν•˜λŠ”λ° 컴퓨터 μ„±λŠ₯에 λ”°λΌμ„œ μ‹œκ°„μ΄ 였래 μ†Œμš”ν•  수 μžˆλ‹€. 

 

λ˜ν•œ .exe 파일둜 λ³€ν™˜μ΄ κ°€λŠ₯ν•΄ ν”„λ‘œκ·Έλž¨μ„ λ°°ν¬ν•˜κΈ°λ„ μ’‹λ‹€. (크둜슀 컴파일이 κ°€λŠ₯ν•΄ λ¦¬λˆ…μŠ€, λ§₯, μœˆλ„μš°μ—μ„œ 컴파일 κ°€λŠ₯)

 

λͺ¨λ“ˆ μ„€μΉ˜
pip install nuitka

 

컴파일
nuitka --standalone --onefile app.py
nuitka --standalone --onefile --windows-icon-from-ico=icon.ico --enable-plugin=tk-inter --windows-disable-console app.py

 

 

주의 사항(ν•œκΈ€ 경둜 문제)

 

λ§Œμ•½ κ²½λ‘œμ— ν•œκ΅­μ–΄κ°€ ν‘œμ‹œλœ 경우 μ•„λž˜μ™€ 같이 κΈ€μžκ°€ κΉ¨μ§€κ²Œ λ˜μ–΄ 컴파일이 μ•ˆ λ˜λŠ” 상황이 μžˆλ‹€. 

LINK : fatal error LNK1104: 'C:\Users\janger\Desktop\?λŠλ€ƒ??1\APP~1.DIS\_nuitka_temp.exe' νŒŒμΌμ„ μ—΄ 수 μ—†μŠ΅λ‹ˆλ‹€.

 

ν•΄κ²°ν•˜κΈ° μœ„ν•΄ κ²½λ‘œμ— ν•œκΈ€μ΄ 없도둝 ν•œ λ‹€μŒ λ‹€μ‹œ μ»΄νŒŒμΌμ„ μ§„ν–‰ν•œλ‹€. 

 

좜처 및 μ°Έκ³ : 

https://wikidocs.net/228946

 

Nuitka: μ‹€ν–‰ κ°€λŠ₯ν•œ λ°”μ΄λ„ˆλ¦¬ 파일 생성을 μœ„ν•œ Python 컴파일러

![](https://wikidocs.net/images/page/228946/Nuitka_logo.png) NuitkaλŠ” Python μ½”λ“œλ₯Ό C/C++ μ½”λ“œλ‘œ λ³€ν™˜ν•΄ μ‹€ν–‰ …

wikidocs.net

 

https://nuitka.net/user-documentation/user-manual.html

 

Nuitka User Manual β€” Nuitka the Python Compiler

For analysis of your program and Nuitka packaging, the Compilation Report is available. You can also make custom reports by providing your template or using one built-in to Nuitka. These reports carry all the detailed information; for example, when a modul

nuitka.net

 

728x90