Pyinstaller的安裝和使用

2021-10-19 11:43:53 字數 362 閱讀 2590

我們可使用pyinstaller對python程式進行打包。下面對pyinstaller的安裝和使用,以及使用過程中需要注意的細節進行說明。

我們使用pip安裝pyinstaller,pip的安裝方式也很簡單: pip install pyinstaller

打包程式以windows為例也是在cmd下執行命令,將目錄切換制程式所在目錄位置,執行命令:

pyinstaller -f 《程式名》.py

pyinstaller還可以對打包的程式圖示進行設定,具體方法:

pyinstaller -i 《圖示名》.ico -f 《程式名》.py

這裡在使用過程中需要注意一些小細節:

pyinstaller安裝失敗

報錯如下 error command errored out with exit status 1 command d python python.exe d python lib site packages pip vendor pep517 in process.py prepare metad...

pyinstaller的安裝 使用 引數介紹

建議使用pip命令進行安裝,方便快捷,如下 pip install pyinstaller首先,在需要打包的 py檔案所在目錄下開啟cmd視窗,然後,使用如下命令進行打包。pyinstaller f py h,help 檢視該模組的幫助資訊 f,onefile 產生單個可執行檔案 d,onedir ...

安裝pyinstaller遇到的各種問題 小結

環境win7,anaconda3 使用的python版本是3.6.5 anaconda中整合了大部分常用的第三方庫,例如numpy等,但是有一些沒有整合需要手動安裝載入,之前安裝第三方庫使用的指令是 pip install 代表庫名字 問題1一如往常的安裝方法,pip install pyinsta...