pyInstaller 打包QT程序的環境的建立

1、新電腦安裝python + pyQT環境

      由於工作需要在公司的電腦上面安裝了python(3.6) + pyQT,這裏爲什麼安裝python 3.6沒有用於最新的3.9呢,因爲我自己的電腦安裝的就是3.6。 pyQT直接使用的pip進行安裝,pip會默認安裝能用的最新的版本程序,即pyQT安裝成了5.14.2版本,同時安裝了其他相關的軟件包。最後的環境如下:

C:\Users\Administrator>pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
altgraph (0.17)
certifi (2020.4.5.1)
chardet (3.0.4)
cycler (0.10.0)
et-xmlfile (1.0.1)
future (0.18.2)
idna (2.9)
jdcal (1.4.1)
kiwisolver (1.2.0)
macholib (1.14)
matplotlib (3.2.2)
numpy (1.19.0)
openpyxl (3.0.3)
packaging (20.4)
pefile (2019.4.18)
pip (9.0.1)
PyInstaller (3.3)
pyparsing (2.4.7)
pypiwin32 (223)
PyQt5 (5.14.2)
PyQt5-sip (12.7.2)
pyserial (3.4)
PySimpleGUI (4.32.1)
python-dateutil (2.8.1)
pywin32 (228)
requests (2.23.0)
setuptools (28.8.0)
sip (5.4.0)
six (1.15.0)
toml (0.10.1)
urllib3 (1.25.8)
You are using pip version 9.0.1, however version 20.3.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

2、打包程序運行

       使用pyInstaller打包了一個原來寫的程序,打包出來的文件比原來大5M,同時無法運行,腳本程序是可以直接運行啓動的。

3、解決問題

       對照原來的電腦的環境及打包的過程的LOG打印,經過各種猜測和嘗試,沒有解決。今天在公司要真正寫一個程序來用於生產測試,突然來了靈感,是不是兩個電腦的pyQT的版本差別導致的,經查自己的電腦的pyQT爲5.8.2和公司電腦的pyQT 5.14.2不一樣,那就試試吧,果斷卸載5.14.2,安裝上5.8.2,打包程序可以運行了。

C:\Users\Administrator>pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
altgraph (0.17)
certifi (2020.4.5.1)
chardet (3.0.4)
cycler (0.10.0)
et-xmlfile (1.0.1)
future (0.18.2)
idna (2.9)
jdcal (1.4.1)
kiwisolver (1.2.0)
macholib (1.14)
matplotlib (3.2.2)
numpy (1.19.0)
openpyxl (3.0.3)
packaging (20.4)
pefile (2019.4.18)
pip (9.0.1)
PyInstaller (3.3)
pyparsing (2.4.7)
pypiwin32 (223)
PyQt5 (5.8.2)
PyQt5-sip (12.7.2)
pyserial (3.4)
PySimpleGUI (4.32.1)
python-dateutil (2.8.1)
pywin32 (228)
requests (2.23.0)
setuptools (28.8.0)
sip (4.19.8)
six (1.15.0)
toml (0.10.1)
urllib3 (1.25.8)
You are using pip version 9.0.1, however version 20.3.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章