解決python打包成EXE檔案不能執行的問題

2021-08-22 17:55:54 字數 495 閱讀 4919

使用pyinstaller將python打包成可執行檔案出現問題,執行exe時顯示沒有pyqt5.sip

網上兩個辦法

1,在打包時 cmd裡面 使用 pyinstaller c:\users\administrator\dist\image2text-master/main.py替換成pyinstaller –hidden-import pyqt5.sip c:\users\administrator\dist\image2text-master/main.py

2,解除安裝pyinstaller 使用pip uninstaller pyinstaller ,然後使用pip install

執行以後那個問題解決了又有新問題,顯示找不到c:\users\administrator\dist\main\qcandyui\candyui\theme.json

回頭看看生成的執行資料夾裡沒有qcandyui這個資料夾,於是自己加了個資料夾然後把python裡的theme.json新增進去就好了

python檔案打包成exe

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

python 打包成exe程式

1.需要安裝 py2exe 2.示例 exetest.py 建立乙個gui介面,只用乙個標籤和按鈕,無功能 from tkinter import win tk label label win,text hello btn button win,text click label.pack btn.p...

python打包成EXE檔案

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