將python檔案打包成exe可執行檔案

2022-09-03 11:18:08 字數 995 閱讀 9155

作業系統:win8-64位

python版本:3.5

pywin32版本:pywin32-219.win-amd64-py3.5

打包步驟:

1、安裝pywin32

2、解壓縮pyinstaller的zip包到任何目錄,我的解壓目錄是:c:\program files\python35\pyinstaller-3.2

3、在cmd視窗,cd c:\program files\python35\pyinstaller-3.2目錄,執行命令:python3 setup.py install(安裝pyinstaller)

4、將py檔案放到任何目錄,我的目錄是:c:\program files\python35\pyinstaller-3.2\002.py

5、在cmd視窗,cd c:\program files\python35\pyinstaller-3.2目錄,執行命令:python3 pyinstaller.py -f 002.py

6、exe打包成功後,在c:\program files\python35\pyinstaller-3.2\002\dist\002.exe目錄可看到

作業系統:win8-64位

python版本:2.7

pyinstaller版本:2.0

pywin32版本:pywin32-219.win32-py2.7

打包步驟:

1、安裝pywin32

2、解壓縮pyinstaller的zip包到任何目錄,我的解壓目錄是:c:\python27\pyinstaller-2.0

3、將py檔案放到任何目錄,我的目錄是:c:\python27\pyinstaller-2.0\002.py

4、在cmd視窗,cd c:\python27\pyinstaller-2.0目錄,執行命令:python pyinstaller.py -f 002.py

5、exe打包成功後,在c:\python27\pyinstaller-2.0\002\dist\002.exe目錄可看到

將python檔案打包成exe

使用pyinstaller將python檔案打包成exe可執行檔案 2 安裝pyinstaller庫 兩種方式 1 whl 檔案安裝 在彈出的cmd命令視窗直接使用pip install pyinstaller 3.6 py2.py3 none any.whl即可 或者win r開啟命令視窗,輸入p...

python檔案打包成exe

將自己寫的python檔案壓縮成exe有兩種方法 1 使用pyinstaller step1 安裝pyinstaller,在cmd視窗使用pip install pyinstaller安裝 step2 cd 到你的檔案目錄cd d py python testcases slice step3 執行...

python打包成EXE檔案

在我們完成乙個python專案或乙個程式時,由於不可能讓使用者去安裝一些環境,所以希望將python的py檔案打包成在windows系統下直接可以執行的exe程式。在這裡我用的是pyinstaller來打包檔案 首先安裝pyinstaller pip install pyinstaller 輸入 格...