Pythonã®ã³ã¼ããwindowsç¨exeã«ããã«ã¯å½ç¶ã py2exe ã使ãã¾ãã ã§ããã®ã¨ãã 1python setup.py py2exe --windows ã¨ããã°ãã³ã³ã½ã¼ã«ã表示ããªãããã«ã§ãã¾ãã ããã¯ããå¤ãããæ¹ã§ãç¾å¨ã®ãã¼ã¸ã§ã³ã®py2exeã§ã¯åãã¾ããã»ã»ã»ãç¾å¨ã¯ã¿ã¼ã²ãããã¡ã¤ã«ã®æ¡å¼µåã.pywã«ãããããã㯠windows = [{'script' : 'script.py', "icon_resources": [(1,"script.ico")]}] ã¨ãããªãã·ã§ã³ãsetupã«æ¸¡ããã¨ããæ¹æ³ã«ãªã£ã¦ãã¾ãã ä»æ¥ãæpy2exeã§ä½ã£ããã¡ã¤ã«ãåºã¦ãããã§ãããå°ã£ããã¨ã«pythonã®ã½ã¼ã¹ãã¡ã¤ã«ã¯ãªãããããå¥ã«æ¹è¯ã¨ãããããªãããããã ãã©ã ãµã¨èµ·åãã¦ã¿ãã¨GUI with consoleããã£ã¡ããããã ã³ã³ã½
setup.py㧠windows = [ {"script" : "***.py",} ],"windows ="ã¨ããã°ã³ã³ã½ã¼ã«ã¯è¡¨ç¤ºãããªããªã£ãã "console ="ã¨ããã°ã³ã³ã½ã¼ã«è¡¨ç¤ºã«æ»ãã (exeåããpyãã¡ã¤ã«ã®æ¡å¼µåã.pywã«ãã¦ãåæ§ã®å¹æããã㨠ã©ããã«æ¸ãã¦ãã£ããã©ãã¡ã ã£ã)
ã¯ããã« å 人ã«ä½ã£ã¦ããã£ããã¼ã¿å¤æç¨ã®Pythonã¹ã¯ãªãããé¨ç½²å ã§ä½¿ç¨ãã¦ããã®ã ããPythonç°å¢ã®ãªãã¡ã³ãã¼ã«å±éããããã«exeåãããã¨ã«ããã ã²ã¨ã¾ãPyinstallerã試ããã®ã ãã¨ã©ã¼åºããéããã§ãPy2exeã試ããã¨ã«ããã çµè«ããè¨ãã¨ãExcelã®ç¯å²ã§æ¸ããããªãã¼ã¿å¦çã¯ããã¯ããçµãã æ¹ã⦠åæ é å¸å ã¯Pythonç°å¢ã®ãªããããã°ã©ã ã«ãªãã¿ã®ãªãã¡ã³ãã¼ã¨ããã(ï¼ç°¡åã«exeãèµ·åããã ãã«ããã) exeä½æå´ã®ç°å¢ã¯ä»¥ä¸ã®éãã OSï¼Windows10 Dockerï¼v20.10.6 Pythonï¼3.9.5 Pyinstallerï¼4.3 Py2exeï¼0.10.4.0 exeä½æç°å¢ã®æºå Anacondaç°å¢ã§ã®exeä½æã¯ãããã»ãããã Anacondaã§å¤æ°ã®ã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ããç¶æ ã ã¨ããã¡ãã¡ã®ã©ã¤
Pythonã§ä½æããã¢ããªãé å¸ããå ´åãexeã¨ãã¦é å¸ãããã§ãããã exeåããããã°ãçªã®æãVecorã§ãå ¬éã§ããããã«ãªãã¾ãã ãããªãã¨ã¾ã§å¯è½ã«ããã®ããpy2exeã§ãã æ¬è¨äºã®å 容 py2exeã¨ã¯ï¼py2exeã®ã·ã¹ãã è¦ä»¶py2exeã®ã¤ã³ã¹ãã¼ã«py2exeã®åä½ç¢ºèª ããã§ã¯ãä¸è¨ã«æ²¿ã£ã¦è§£èª¬ãã¦ãã¾ãããã py2exeã¨ã¯ï¼ py2exeã¯ãPythonã¹ã¯ãªããããã¹ã¿ã³ãã¢ãã³ã®Windowså®è¡ããã°ã©ã ããã«ãããããã®distutilsæ¡å¼µæ©è½ã§ãã ç°¡åã«è¨ãã¨ãpy2exeã§Pythonããã°ã©ã ãexeåã§ããã¨ãããã¨ã§ãã ã¾ããpy2exeã®æ´å²ã¯é·ãã§ãã ãã§ã«2003å¹´æç¹ã§ã¯ãVersion0.3.4ãå ¬éããã¦ãã¾ãã ããã¦ã2021å¹´ã«ãªã£ãç¾å¨ã§ã常ææ´æ°ããã¦ãã¾ãã ææ°ãã¼ã¸ã§ã³ã¯ã2021å¹´1æ22æ¥ã«
æ¥åã§å¿ è¦ã«ãªã調ã¹ãã試ããããã¦ã¿ãã®ã§ãè¨é²ãã¦ãåæ稿ã py2exeã¨pyinstallerã使ç¨ããæçµçã«pyinstallerã使ç¨ãã¦ãã¾ãã è¨è¿°ã¯å ¨ã¦pipenvã§ã®ä»®æ³ç°å¢ä¸ãæ³å®ãã¦ãã¾ãã1 é©å®èªã¿æ¿ãã¦ãã ããã 誤ã£ã¦ããç®æãªã©ããã°æ°è»½ã«ã³ã¡ã³ãçãé¡ããã¾ãã ç°å¢ Windows 10 version 2004 (May 2020 Update) pipenv 2020.8.13 python 3.8.5 numpy 1.19.2 pandas 1.1.2 py2exe 0.9.3.2 or pyinstaller 4.0 py2exe è²ã 調ã¹ãã¨ãããpyinstallerãã軽éãã¤é«éï¼ã¨ãã£ãã®ã§ä½¿ç¨ãã¦ã¿ãããpandasãscipyãªã©ã®ã¢ã¸ã¥ã¼ã«ãããã¨ä½æ ãä¾åãã¡ã¤ã«ã«æ¼ããåºã¦ãå®è¡æã«importã¨ã©ã¼ãåºãã (numpy
The detailed changelog is published on GitHub. Version 0.13.0.2: reintroduce ability to specify different version info for each of the frozen binaries fix a bug in MemoryModule.c:PerformBaseRelocation fix missing initialization settings for the runtime Python interpreter add support for setuptools v72 fix the matplotlib, numpy, and scipy hooks fix py2exe wheels build with setuptools v70.0.0 Versio
Tkinterãå©ç¨ããã¢ã¸ã¥ã¼ã«ãpy2exeã§exeåããããå®è¡æã« åé¡ãçºçãããããexample.exe ãçµäºãã¾ãã ãä¸ä¾¿ãããããã¦ç³ã訳ããã¾ããã ã¨ãããã¨ã©ã¼ãã Pythonã¹ã¬ã®ãã£ãã·ã¥ã«74çªã®åæ§ã®ã¨ã©ã¼ã®è§£æ¶æ¹æ³ã®æ¸ãè¾¼ã¿ããã£ã¦å©ãã£ãã åå ã¯ä¸æã ãã©ãbundle_filesã¯3ã«ãã¦ããã³ãã«ã¬ãã«ãçµå度ãä½ãã®ã«ããªãã¨ãããªãã¿ããã from distutils.core import setup import py2exe py2exe_options = { "compressed": 1, "optimize": 2, "bundle_files": 3} setup( options = {"py2exe": py2exe_options}, windows = [ {"script" : "passwd_generato
表é¡ã®æ¹æ³ã«ã¤ãã¦èª¿ã¹ã¦ã¿ã¾ãããPython 3.5ã§åãããã¨ãç®æ¨ãªã®ã§ãããããã£ã¦ãã¦ã¾ã åãã¦ãã¾ããã以ä¸ã調æ»ããå 容ã®ã¡ã¢ã§ãã py2exeã使ãæ¹æ³ py2exeã¯ãPython 2ç³»ã¨Python 3ç³»ã¨ã§é å¸å ´æãç°ãªãã¾ãã Python 2ç³»ã®å ´åãpy2exe download | SourceForge.netããã¤ã³ã¹ãã¼ã©ããã¦ã³ãã¼ããã¦ã¤ã³ã¹ãã¼ã«ããããã§ããã¤ã³ã¹ãã¼ã©ã®æ¥ä»ãå¤ãã§ããã2005å¹´æç¹ã§py2exeã§Pythonã®ã¹ã¯ãªãããå®è¡ãã¡ã¤ã«(exe)ã«ãããpy2exeã - ã´ãã´ã.pyã§åä½å ±åãããã®ã§ãããããåãã¯ãã§ãã Python 3ç³»ã®å ´åãpy2exe 0.9.2.0 : Python Package Indexã«ããããã«ãpip install py2exeã§ã¤ã³ã¹ãã¼ã«ããããã§ãããã ãããµã¤ãã«ã¯
pythonå®è¡ãã¡ã¤ã«å¤æã©ã¤ãã©ãªæ¯è¼ï¼py2exe, cx_freeze, pyinstallerï¼Pythonpy2execx_FreezePyInstaller ã¯ããã« pythonã§å®è¡å½¢å¼ã«å¤æããã©ã¤ãã©ãªãããã¤ãããã¾ãããçµå±ã©ãã使ãã°è¯ãã®ãããããªãã£ãã®ã§ãã¾ã¨ãã¦è©¦ãã¦ã¿ã¾ãã ä»å使ã£ãã³ã¼ã㯠https://github.com/nabehide/tryFreezing ã«ããã¾ã æ¯è¼ããã©ã¤ãã©ãªã¯ä¸è¨ã®ï¼ã¤ã§ãã py2exe cx_Freeze PyInstaller ï¼py2appã¯Windowsæªå¯¾å¿ã®ãããä»åã¯ä½¿ãã¾ãããï¼ ç°å¢ Windows7 32bit professional CPU : Core-i5-4310U 2.00GHz RAM : 4GB Pythonç°å¢ Python 2.7 numpy : 1.11.2 ma
ããä½ã¶æããã¹ã¯ãããã¢ããªã±ã¼ã·ã§ã³ã«ã©ã£ã·ããªæãã§ããããã±ã¼ã¸ã³ã°ããã£ã¨ç°¡åã«ãããï¼ã¨ãããã¨ã§è²ã ã¨è©¦è¡é¯èª¤ãã¦ããã¾ãããlinux, mac ã¯ããæãã§ãããWindows ã¯ã»ã»ã» py2exe ã§ããªã¼ã¸ã³ã°ã®ã¿ãããã¦ãã¾ããã§ãããé å¸ã¨ã¤ã³ã¹ãã¼ã«ã¯èªå解åæ¸åº«ãã¢ãããã¼ããã¢ã³ã¤ã³ã¹ãã¼ã«ã¯ã»ã»ã»ãããã§ä»å (ãã£ã¨) è¦ããã®ã Inno Setup ã WiX ã¨ãã£ã Windows ç¨ã®ããã±ã¼ã¸ãã«ãã§ããåå¿é²ãã¦ããPython ã§ã®ããã±ã¼ã¸ã³ã°ãã¾ã¨ãã¦ã¿ã¾ããã ããã±ã¼ã¸ã³ã°ã«ã¤ã㦠大ãã 2 ã¤ã®ãã§ã¼ãºã«åããã¦ãã¾ãã ããªã¼ã¸ã³ã°: Python ãã³ãã«ãä»ã®å¿ è¦ãªã©ã¤ãã©ãªã¼ãå¯ãéããå®è¡å¯è½å½¢å¼ã«ã¾ã¨ãã¾ãã Windows 㨠OS X ã«ã¤ãã¦ã¯ä»¥ä¸ã®ã©ã¤ãã©ãªã§ããªã¼ã¸ã³ã°ãã¾ãã Windows ç¨: p
ç¹å¾´ py2exeãã¼ã : http://www.py2exe.org/ Pythonæ¨æºã®distutilsã®ãã©ã°ã¤ã³ã§ãã pythonã§ä½æããã¹ã¯ãªãããããä¾åã©ã¤ãã©ãªãæ¤ç´¢ãã¦ã åéãããã¡ã¤ã«ç¾¤ã ãã§å®è¡å¯è½ãªãã¤ããªãä½æããæ©è½ãæã£ã¦ãã¾ãã æè¿ã®ãã¼ã¸ã§ã³ã«ãªã£ã¦ããã³ãã«ã¬ãã«ãé¸æã§ããããã«ãªãã åç¬ã®exeãã¡ã¤ã«ã«çµã¿ä¸ãã Python25.dllã¨MSVC71.dllã¨exeã®ï¼ã¤ã«çµã¿ä¸ãã ä¾åã©ã¤ãã©ãªãã¢ã¼ã«ã¤ãã¾ãã¯ãã©ã«ãã«åé¢ãã ã¨ãã£ãæ··æ度åããæå®ã§ããããã«ãªãã¾ããã åç¬ã®exeã«ãã¡ããã¨ãPythonã©ã³ã¿ã¤ã ã¾ã§å èãã¦ãã¾ãã®ã§ã·ã³ãã«ãªã¹ã¯ãªãããï¼ã¡ã¬ãã¤ããè¶ ãã¦ãã¾ãã¾ãã
ä¸ã®NWã¨ã³ã¸ãã¢ã®ã ããç³»æ¥åãå°ãã§ãæå©ãã§ããã°ã¨èããã¨ããã£ã±ãexeåãã¦å©ç¨ç¯å²ãåºãããã¨ãå¿ é é ç®ã¨ãªã£ã¦ãã¾ãã ç°¡åãªæµãã¨ãã¦ã¯ã以ä¸ã®ãããªæãã§ãã 1.py2exeã®ãã¼ã¸ããpy2exeæ¬ä½ã®ããã°ã©ã ãæ¾ã£ã¦ããã http://www.py2exe.org/ 2.ã¤ã³ã¹ãã¼ã«ããã 3.setup.pyã¨ããexeåå°ç¨ã®ã¹ã¯ãªãããæ¸ãã 4.setup.pyã¨exeã«ãããã¹ã¯ãªãããåããã£ã¬ã¯ããªã«ç½®ãã¦ãã³ãã³ãããã³ãããã該å½ãã£ã¬ã¯ããªã«ç§»åããpython setup.py py2exeãå®è¡ããã setup.pyã¯çµæ§è©³ãã解説ãã¦ãããµã¤ãããã£ã±ãããã®ã§ãã°ã°ãã¨ããããè¦ã¤ããã¨æãã¾ãããåãæ¸ããã®ã¯ä»¥ä¸ã®ãããªå 容ã§ãã from distutils.core import setup import py2exe o
æ¨æºçãªããªã¼ã¸ã³ã° # setup.py import py2exe from distutils.core import setup py2exe_options = { "compressed": 1,ã# å§ç¸®ãã "optimize": 2, "bundle_files": 3, "includes" : ["sip",] } setup( options={"py2exe" : py2exe_options}, windows=[{"script" : "main.py"}], # PyQt ãã¡ã¤ã« zipfile="[zipped.libããã¡ã¤ã«å]", ) ç§ã®ç°å¢ (XP, Py2.6.4) ã§ã¯ã py2exe_options ã® bundle_files 㯠3 (åå²ãã¡ã¤ã«) ãããªãã¨åä½ãã¾ããã§ããã jpeg ã gif çã®ç»åãåãæ±ãå ´å PyQ
Pythonã®ã¹ã¯ãªããï¼.pyï¼ãWindowsã®å®è¡å½¢å¼ã§ããexeãã¡ã¤ã«ã¸å¤æãããã¨ãã§ãã¾ããpy2exeã使ç¨ããexeåãè¡ã£ã¦ã¿ã¾ãããã py2exeã®ã¤ã³ã¹ãã¼ã« Python 3.3 / 3.4ã§ã¯ ä¸è¨ã³ãã³ããå ¥åãpy2exeãã¤ã³ã¹ãã¼ã«ãã¦ãã ããã â»ããã¯pipãã¤ã³ã¹ãã¼ã«ããã¦ãããã¨ãåæã¨ãã¦ãã¾ããã¤ã³ã¹ãã¼ã«ãã¦ããªãå ´åã¯pipã®ä½¿ãæ¹ã¨ã¤ã³ã¹ãã¼ã«ãåç §ãã¦ãã ããã â»py2exeã¯2017å¹´9ææç¹ã§ã¯Python 3.5 / 3.6 ã«ã¯å¯¾å¿ãã¦ãã¾ãããã¤ã³ã¹ãã¼ã«ãããã¨ã¯ã§ãã¾ãããexeå¤æä¸ã«ã¨ã©ã¼ãçºçãã¾ãã pip install py2exe Python 2ç³»ã§ã¯ ä¸è¨ãªã³ã¯ããã¤ã³ã¹ãã¼ã©ããã¦ã³ãã¼ããã¦ãã ããã ãã¦ã³ãã¼ãçµäºå¾ãã¤ã³ã¹ãã¼ã«ãè¡ãã¾ããå ¨ã¦ããã©ã«ãè¨å®ã§æ§ãã¾ããã exeå¤æä¾
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}