1. 程式人生 > >如何將python的專案部署到其他沒有安裝python環境的電腦

如何將python的專案部署到其他沒有安裝python環境的電腦

首先安裝pyinstaller

命令pip3 install pyinstaller

到專案要執行的程式碼的那個.py檔案(例如testPyinstaller.py),右鍵copy path,

(例如我的是D:\workspaceForPy\testPyinstaller\.idea\testPyinstaller.py)

到專案目錄(idea右鍵show in explorer)

 

在cmd視窗執行 pyinstaller D:\workspaceForPy\testPyinstaller\.idea\testPyinstaller.py

 

然後專案目錄裡就有一個dist的資料夾,裡面有一個testPyinstaller的資料夾,將這個資料夾壓縮後,拿到其他電腦,解壓縮後執行裡面的testPyinstaller.exe