win10 pyinstaller pyqt5 界面 打包exe(封装)

本文不是详细教程,新人可查看其它文章作为参考。如:https://blog.csdn.net/yuhijk2055/article/details/80876970 

pip install pyinstaller

1,打包命令:

      pyinstaller -F -w xxxx.py  (xxxx代表要打包的文件)

      pyinstaller xx.spec (修改spec文件后运行)

程序里需要什么module就把什么的名字放到xx.spec文件中的hiddenimports列表内。

 

2,打包报错解决方法:https://blog.csdn.net/windows_peng/article/details/81285658

【报错】ImportError: No module named 'sklearn.utils.cython_blas'

【解决】https://blog.csdn.net/baidu_36536257/article/details/90609379

【报错】Microsoft Visual C++ 14.0 is required.

【解决】安装 ms build tools 2019,我觉得安装这个也够了。(https://aka.ms/vs/16/release/VC_redist.arm64.exe)

【报错】cannot import name _macosx

【解决】这个报错不用管 - -!

【报错】No module named wx

【解决】安装wxpython

【报错(警告)】warning one binary added with two internal names

【解决】这个报错不用管 - -!

 

# no module 问题
hiddenimports=['cython','sklearn','sklearn.ensemble','sklearn.neighbors.typedefs','sklearn.neighbors.quad_tree','sklearn.tree._utils','scipy._lib.messagestream', 'matplotlib.backends'],

# backend问题https://github.com/matplotlib/matplotlib/issues/2976
pip install cairocffi
# 下载安装cairo: https://github.com/cairoshell/cairoshell/releases/tag/v0.3.6781

# 还是报错:
# OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2

# 安装gtk+: https://www.gtk.org/download/windows.php

# 又报错:
# Warning: The following VS instances are excluded because the English language pack is 
# unavailable.
#     D:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
# Please install the English language pack.
# Could not locate a complete toolset.

# 重新安装语言包:https://github.com/Microsoft/vcpkg/issues/3842
# https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16

# 又报错
# Error: Building package libepoxy:x64-windows failed with: BUILD_FAILED

# 参照:https://github.com/Microsoft/vcpkg/issues/4328
# 把vcpkg-master放到一个非中文目录或者名称没有空格、横杠之类的的目录下,如放在D盘根目录,然后再运行:
> cd vcpkg-master
> bootstrap-vcpkg.bat
> vcpkg install gtk:x64-windows

# install的过程中要下载各种包,可以使用IDM下载器下载好后直接放到downloads文件夹,然后再重新运行命令。


# 安装完成了
# 没用,还是报下面这两个错
# OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2
# UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 152: invalid continuation byte

# 针对第二个错误,按照https://stackoverflow.com/questions/47692960/error-when-using-pyinstaller-unicodedecodeerror-utf-8-codec-cant-decode-byt
# 把C:\Users\xxx\AppData\Local\Programs\Python\Python36\Lib\site-packages\PyInstaller\compat.py中的两处out = out.decode(encoding)改成了out = out.decode(encoding, 'replace')

# 打包成功了,但运行打包好的exe文件还是报 DLL load failed 错误,*了狗了 

# 改回 compat.py
# 卸载 cairocffi
# 安装指定版本
pip install cairocffi==0.6

# 报错:


# 参照:https://blog.csdn.net/qq_35203425/article/details/78568141
# 重新安装pyinstaller 3.3 安装pywin32


# 还是不行,
# 参照http://cn.voidcc.com/question/p-snouqkqb-qp.html到https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycairo
# 下载安装 pycairo-1.18.1-cp36-cp36m-win_amd64.whl

# 安装成功。重新打包之后该死的OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2 错误终于消失

# 然后报找不到pyqt5 plugin的错误:
# 未解决

# 又看到
# failed to import any qt binding


# 恢复pyinstaller 3.5版本
# 安装pypiwin32
# https://pypi.org/project/pypiwin32/


重新安装64位的pywin32

。。。。无果

最终是怎么解决的呢?换了台电脑。使用Python3.5进行打包!

主要原因:pyinstaller和python3.6不太兼容。以下内容全凭回忆复盘:

新环境配置如下:

OS: Microsoft Windows 10 专业版 17134 64 位

CPU: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
16384 M

DISK:
C: free: 50544 M         All: 120106 M
D: free: 321403 M        All: 355940 M

# bios版本 生产厂家 释放日期
BIOS: LENOVO - 1140
LENOVO
20170630000000.000000+000

Python的版本:

win10 pyinstaller pyqt5 界面 打包exe(封装)_第1张图片

 

另:安装了很多包和软件(这些都是必须的):

Package             Version
------------------- ----------
altgraph            0.16.1
backcall            0.1.0
Click               7.0
colorama            0.4.1
cycler              0.10.0
Cython              0.29.12
decorator           4.4.0
et-xmlfile          1.0.1
future              0.17.1
ipykernel           5.1.1
ipython             7.6.1
ipython-genutils    0.2.0
jdcal               1.4.1
jedi                0.14.1
joblib              0.13.2
jupyter-client      5.3.1
jupyter-core        4.5.0
kiwisolver          1.1.0
matplotlib          3.0.3
numpy               1.16.4
openpyxl            2.6.2
pandas              0.24.2
parso               0.5.1
pefile              2019.4.18
pickleshare         0.7.5
Pillow              6.1.0
pip                 19.1.1
prompt-toolkit      2.0.9
pycairo             1.18.1
Pygments            2.4.2
PyInstaller         3.5
pyparsing           2.4.0
PyQt5               5.11.3
PyQt5-sip           4.19.18
pyqt5-tools         5.11.3.1.4
python-dateutil     2.8.0
python-dotenv       0.10.3
pytz                2019.1
pywin32             224
pywin32-ctypes      0.2.0
pyzmq               18.0.2
scikit-learn        0.21.2
scipy               1.3.0
setuptools          28.8.0
six                 1.12.0
sklearn             0.0
tornado             6.0.3
traitlets           4.3.2
wcwidth             0.1.7
win-unicode-console 0.5
WMI                 1.4.9
wxPython            4.0.6

以下包和软件为手动下载安装文件后进行安装:

 'pip-19.1.1.tar.gz',
 'python-3.5.4-amd64.exe',
 'pycairo-1.18.1-cp35-cp35m-win_amd64.whl', 
'pywin32-224.win-amd64-py3.5.exe', # https://github.com/mhammond/pywin32/releases
 'vs_buildtools__2019502252.1560496478.exe', # 运行后勾选生产工具(build tools)和通用工具,即第一项和第三项,选择英文安装包
 'PyGObject-3.32.2.tar.gz', # 这个好像不用安装
 'vc_redist.x64.exe', # 这个好像没有安装
 'vc_redist.arm64.exe', # https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
# https://aka.ms/vs/15/release/vc_redist.x64.exe

xx.spec文件如下:

# -*- mode: python ; coding: utf-8 -*-

block_cipher = None


a = Analysis(['cn35.py'],
             pathex=['C:\\Users\\ThinkPad\\Desktop\\py'],
             binaries=[],
             datas=[],
             hiddenimports=['cython','sklearn','sklearn.utils._cython_blas','sklearn.neighbors.typedefs','sklearn.neighbors.quad_tree','sklearn.tree._utils'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name='cn35',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=True )

我的被打包程序xx.py中import了以下包:

import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
import os
import time

# 如果编译之后运行exe文件提示缺少一些这里没有涉及的module,可能是代码中间接地使用到了相应的module,需要在这里加上,即显式的import它。
# 如代码中需要打开excel,但是单独运行.py文件时不需要在文件中import openpyxl,但是为了打包成exe也能运行,需要在上述代码中再加入一条:import openpyxl
# 参考:
# 编译完之后.py文件中这句(import openpyxl)好像又消失了,所以仅供参考。

其他安装的软件:

 

win10 pyinstaller pyqt5 界面 打包exe(封装)_第2张图片

 

正确的编译输出(可以看到部分错误是可以忽略的,不影响结果):

#############先编译.py文件,特别是代码有修改之后一定要重新编译.py文件########################


>pyinstaller -F cn35.py
78 INFO: PyInstaller: 3.5
78 INFO: Python: 3.5.4
78 INFO: Platform: Windows-10-10.0.17134-SP0
93 INFO: wrote C:\Users\ThinkPad\Desktop\py\cn35.spec
93 INFO: UPX is not available.
93 INFO: Extending PYTHONPATH with paths
['C:\\Users\\ThinkPad\\Desktop', 'C:\\Users\\ThinkPad\\Desktop\\py']
93 INFO: checking Analysis
93 INFO: Building Analysis because Analysis-00.toc is non existent
93 INFO: Initializing module dependency graph...
109 INFO: Initializing module graph hooks...
109 INFO: Analyzing base_library.zip ...
3671 INFO: running Analysis Analysis-00.toc
3671 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\thinkpad\appdata\local\programs\python\python35\python.exe
3967 INFO: Caching module hooks...
3983 INFO: Analyzing C:\Users\ThinkPad\Desktop\py\cn35.py
4092 INFO: Processing pre-find module path hook   distutils
6264 INFO: Processing pre-find module path hook   site
6264 INFO: site: retargeting to fake-dir 'c:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\PyInstaller\\fake-modules'
7763 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
8357 INFO: Processing pre-safe import module hook   win32com
12184 INFO: Processing pre-safe import module hook   six.moves
40474 INFO: Loading module hooks...
40474 INFO: Loading module hook "hook-sqlite3.py"...
40646 INFO: Loading module hook "hook-IPython.py"...
40662 INFO: Excluding import 'PyQt5'
40662 INFO:   Removing import of PyQt5.QtSvg from module IPython.external.qt_loaders
40662 INFO:   Removing import of PyQt5 from module IPython.external.qt_loaders
40662 INFO:   Removing import of PyQt5.QtWidgets from module IPython.external.qt_loaders
40662 INFO:   Removing import of PyQt5.QtCore from module IPython.external.qt_loaders
40662 INFO:   Removing import of PyQt5.QtGui from module IPython.external.qt_loaders
40677 INFO: Excluding import 'gtk'
40677 INFO: Excluding import 'matplotlib'
40677 INFO:   Removing import of matplotlib.figure from module IPython.core.pylabtools
40677 INFO:   Removing import of matplotlib.pyplot from module IPython.core.pylabtools
40693 INFO:   Removing import of matplotlib._pylab_helpers from module IPython.core.pylabtools
40693 INFO:   Removing import of matplotlib from module IPython.core.pylabtools
40693 INFO: Excluding import 'tkinter'
40693 INFO:   Removing import of tkinter from module IPython.lib.clipboard
40693 INFO: Excluding import 'PyQt4'
40709 INFO:   Removing import of PyQt4 from module IPython.external.qt_loaders
40709 INFO: Excluding import 'PySide'
40709 INFO:   Removing import of PySide from module IPython.external.qt_loaders
40724 INFO: Loading module hook "hook-PyQt5.py"...
40896 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
40896 INFO: Loading module hook "hook-_tkinter.py"...
41146 INFO: checking Tree
41146 INFO: Building Tree because Tree-00.toc is non existent
41146 INFO: Building Tree Tree-00.toc
41224 INFO: checking Tree
41224 INFO: Building Tree because Tree-01.toc is non existent
41224 INFO: Building Tree Tree-01.toc
41240 INFO: Loading module hook "hook-numpy.core.py"...
41365 INFO: Loading module hook "hook-scipy.io.matlab.py"...
41365 INFO: Loading module hook "hook-sysconfig.py"...
41365 INFO: Loading module hook "hook-xml.py"...
41365 INFO: Loading module hook "hook-xml.dom.domreg.py"...
41365 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
41568 INFO: Loading module hook "hook-matplotlib.backends.py"...
42583 INFO:   Matplotlib backend "GTK3Agg": ignored
    The GTK3 backends require PyGObject or pgi
43146 INFO:   Matplotlib backend "GTK3Cairo": ignored
    The GTK3 backends require PyGObject or pgi
43771 INFO:   Matplotlib backend "MacOSX": ignored
    cannot import name '_macosx'
44802 INFO:   Matplotlib backend "nbAgg": added
45458 INFO:   Matplotlib backend "Qt4Agg": added
46114 INFO:   Matplotlib backend "Qt4Cairo": added
46785 INFO:   Matplotlib backend "Qt5Agg": added
47395 INFO:   Matplotlib backend "Qt5Cairo": added
48020 INFO:   Matplotlib backend "TkAgg": added
48629 INFO:   Matplotlib backend "TkCairo": added
49519 INFO:   Matplotlib backend "WebAgg": added
50175 INFO:   Matplotlib backend "WX": added
50816 INFO:   Matplotlib backend "WXAgg": added
51503 INFO:   Matplotlib backend "WXCairo": added
51925 INFO:   Matplotlib backend "agg": added
52394 INFO:   Matplotlib backend "cairo": added
53018 INFO:   Matplotlib backend "pdf": added
53643 INFO:   Matplotlib backend "pgf": added
54127 INFO:   Matplotlib backend "ps": added
54659 INFO:   Matplotlib backend "svg": added
55315 INFO:   Matplotlib backend "template": added
55971 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
56221 INFO: Loading module hook "hook-pydoc.py"...
56221 INFO: Loading module hook "hook-encodings.py"...
56377 INFO: Loading module hook "hook-pandas.py"...
57595 INFO: Loading module hook "hook-jedi.py"...
57736 INFO: Loading module hook "hook-win32com.py"...
57814 INFO: Loading module hook "hook-sklearn.metrics.cluster.py"...
57814 WARNING: Hidden import "sklearn.utils.sparsetools._graph_validation" not found!
57830 WARNING: Hidden import "sklearn.utils.sparsetools._graph_tools" not found!
57830 INFO: Loading module hook "hook-pygments.py"...
59829 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
59907 INFO: Loading module hook "hook-setuptools.py"...
59970 INFO: Loading module hook "hook-PIL.Image.py"...
60407 INFO: Loading module hook "hook-scipy.linalg.py"...
60407 INFO: Loading module hook "hook-pkg_resources.py"...
61079 INFO: Loading module hook "hook-scipy.py"...
61079 INFO: Loading module hook "hook-zmq.py"...
61516 INFO: Loading module hook "hook-scipy.special._ellip_harm_2.py"...
61516 INFO: Loading module hook "hook-scipy.sparse.csgraph.py"...
61516 INFO: Loading module hook "hook-pywintypes.py"...
61860 INFO: Loading module hook "hook-matplotlib.py"...
62251 INFO: Loading module hook "hook-numpy.py"...
62251 INFO: Loading module hook "hook-scipy.special._ufuncs.py"...
62251 INFO: Loading module hook "hook-PIL.py"...
62251 INFO: Excluding import 'PySide'
62266 INFO:   Removing import of PySide from module PIL.ImageQt
62266 INFO: Excluding import 'PyQt5'
62266 INFO:   Removing import of PyQt5.QtGui from module PIL.ImageQt
62266 INFO:   Removing import of PyQt5.QtCore from module PIL.ImageQt
62266 INFO: Excluding import 'tkinter'
62266 INFO:   Removing import of tkinter from module PIL.ImageTk
62266 INFO: Excluding import 'PyQt4'
62282 INFO:   Removing import of PyQt4 from module PIL.ImageQt
62282 INFO: Import to be excluded not found: 'FixTk'
62282 INFO: Loading module hook "hook-pytz.py"...
62344 INFO: Loading module hook "hook-PyQt5.QtSvg.py"...
62719 INFO: Loading module hook "hook-pythoncom.py"...
63063 INFO: Loading module hook "hook-lib2to3.py"...
63079 INFO: Loading module hook "hook-openpyxl.py"...
63079 INFO: Loading module hook "hook-distutils.py"...
63079 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
63094 INFO: Excluding import 'tkinter'
63094 INFO: Import to be excluded not found: 'FixTk'
63282 INFO: Looking for ctypes DLLs
63391 INFO: Analyzing run-time hooks ...
63422 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
63422 INFO: Including run-time hook 'pyi_rth_mpldata.py'
63422 INFO: Including run-time hook 'pyi_rth_pkgres.py'
63422 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
63422 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
63422 INFO: Including run-time hook 'pyi_rth__tkinter.py'
63422 INFO: Including run-time hook 'pyi_rth_pyqt5.py'
63422 INFO: Including run-time hook 'pyi_rth_traitlets.py'
63469 INFO: Looking for dynamic libraries
66078 INFO: Looking for eggs
66078 INFO: Using Python library c:\users\thinkpad\appdata\local\programs\python\python35\python35.dll
66078 INFO: Found binding redirects:
[]
66125 INFO: Warnings written to C:\Users\ThinkPad\Desktop\py\build\cn35\warn-cn35.txt
66687 INFO: Graph cross-reference written to C:\Users\ThinkPad\Desktop\py\build\cn35\xref-cn35.html
66968 INFO: checking PYZ
66968 INFO: Building PYZ because PYZ-00.toc is non existent
66968 INFO: Building PYZ (ZlibArchive) C:\Users\ThinkPad\Desktop\py\build\cn35\PYZ-00.pyz
71498 INFO: Building PYZ (ZlibArchive) C:\Users\ThinkPad\Desktop\py\build\cn35\PYZ-00.pyz completed successfully.
71608 INFO: checking PKG
71608 INFO: Building PKG because PKG-00.toc is non existent
71608 INFO: Building PKG (CArchive) PKG-00.pkg
73045 WARNING: One binary added with two internal names.
73045 WARNING: ('libGLESv2.dll',
 'C:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\PyQt5\\Qt\\bin\\libGLESv2.dll',
 'BINARY')
73061 WARNING: was placed previously at
73061 WARNING: ('PyQt5\\Qt\\bin\\libGLESv2.dll',
 'C:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\PyQt5\\Qt\\bin\\libGLESv2.dll',
 'BINARY')
73139 WARNING: One binary added with two internal names.
73139 WARNING: ('libzmq.cp35-win_amd64.pyd',
 'c:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\zmq\\backend\\cython\\libzmq.cp35-win_amd64.pyd',
 'BINARY')
73154 WARNING: was placed previously at
73154 WARNING: ('zmq\\backend\\cython\\libzmq.cp35-win_amd64.pyd',
 'c:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\zmq\\backend\\cython\\libzmq.cp35-win_amd64.pyd',
 'EXTENSION')
103694 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
103835 INFO: Bootloader c:\users\thinkpad\appdata\local\programs\python\python35\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
103835 INFO: checking EXE
103835 INFO: Building EXE because EXE-00.toc is non existent
103835 INFO: Building EXE from EXE-00.toc
103835 INFO: Appending archive to EXE C:\Users\ThinkPad\Desktop\py\dist\cn35.exe
104053 INFO: Building EXE from EXE-00.toc completed successfully.



################手动修改spec文件加入程序运行时提示缺少的module名称到文件中的hiddenimports列表,然后再继续编译spec文件########################

C:\Users\ThinkPad\Desktop\py>pyinstaller cn35.spec
78 INFO: PyInstaller: 3.5
78 INFO: Python: 3.5.4
78 INFO: Platform: Windows-10-10.0.17134-SP0
93 INFO: UPX is not available.
93 INFO: Extending PYTHONPATH with paths
['C:\\Users\\ThinkPad\\Desktop', 'C:\\Users\\ThinkPad\\Desktop\\py']
93 INFO: checking Analysis
156 INFO: Building because inputs changed
156 INFO: Initializing module dependency graph...
156 INFO: Initializing module graph hooks...
156 INFO: Analyzing base_library.zip ...
3733 INFO: Analyzing hidden import 'cython'
3858 INFO: Processing pre-find module path hook   distutils
6967 INFO: Processing pre-find module path hook   site
6967 INFO: site: retargeting to fake-dir 'c:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\PyInstaller\\fake-modules'
9622 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
10200 INFO: Processing pre-safe import module hook   win32com
15886 INFO: Processing pre-safe import module hook   six.moves
25775 INFO: Analyzing hidden import 'sklearn'
32445 INFO: Analyzing hidden import 'sklearn.utils._cython_blas'
32445 INFO: Analyzing hidden import 'sklearn.neighbors.typedefs'
32445 INFO: Analyzing hidden import 'sklearn.neighbors.quad_tree'
32445 INFO: Analyzing hidden import 'sklearn.tree._utils'
32539 INFO: running Analysis Analysis-00.toc
32539 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\thinkpad\appdata\local\programs\python\python35\python.exe
32851 INFO: Caching module hooks...
32867 INFO: Analyzing cn35.py
40381 INFO: Loading module hooks...
40381 INFO: Loading module hook "hook-win32com.py"...
40459 INFO: Loading module hook "hook-pandas.py"...
41865 INFO: Loading module hook "hook-scipy.linalg.py"...
41865 INFO: Loading module hook "hook-numpy.core.py"...
41865 INFO: Loading module hook "hook-IPython.py"...
41880 INFO: Excluding import 'matplotlib'
41896 INFO:   Removing import of matplotlib.pyplot from module IPython.core.pylabtools
41896 INFO:   Removing import of matplotlib from module IPython.core.pylabtools
41896 INFO:   Removing import of matplotlib._pylab_helpers from module IPython.core.pylabtools
41896 INFO:   Removing import of matplotlib.figure from module IPython.core.pylabtools
41896 INFO: Excluding import 'PyQt5'
41912 INFO:   Removing import of PyQt5.QtSvg from module IPython.external.qt_loaders
41912 INFO:   Removing import of PyQt5.QtCore from module IPython.external.qt_loaders
41912 INFO:   Removing import of PyQt5.QtGui from module IPython.external.qt_loaders
41912 INFO:   Removing import of PyQt5 from module IPython.external.qt_loaders
41912 INFO:   Removing import of PyQt5.QtWidgets from module IPython.external.qt_loaders
41927 INFO: Excluding import 'tkinter'
41927 INFO:   Removing import of tkinter from module IPython.lib.clipboard
41927 INFO: Excluding import 'gtk'
41943 INFO: Excluding import 'PySide'
41943 INFO:   Removing import of PySide from module IPython.external.qt_loaders
41943 INFO: Excluding import 'PyQt4'
41958 INFO:   Removing import of PyQt4 from module IPython.external.qt_loaders
41958 INFO: Loading module hook "hook-zmq.py"...
42365 INFO: Loading module hook "hook-PIL.Image.py"...
42927 INFO: Loading module hook "hook-numpy.py"...
42927 INFO: Loading module hook "hook-PyQt5.py"...
43114 INFO: Loading module hook "hook-sqlite3.py"...
43255 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
43349 INFO: Loading module hook "hook-openpyxl.py"...
43349 INFO: Loading module hook "hook-matplotlib.py"...
43739 INFO: Loading module hook "hook-sysconfig.py"...
43739 INFO: Loading module hook "hook-scipy.py"...
43739 INFO: Loading module hook "hook-PIL.py"...
43755 INFO: Excluding import 'PyQt4'
43755 INFO:   Removing import of PyQt4 from module PIL.ImageQt
43755 INFO: Excluding import 'PyQt5'
43755 INFO:   Removing import of PyQt5.QtCore from module PIL.ImageQt
43755 INFO:   Removing import of PyQt5.QtGui from module PIL.ImageQt
43755 INFO: Excluding import 'PySide'
43771 INFO:   Removing import of PySide from module PIL.ImageQt
43771 INFO: Import to be excluded not found: 'FixTk'
43771 INFO: Excluding import 'tkinter'
43771 INFO:   Removing import of tkinter from module PIL.ImageTk
43771 INFO: Loading module hook "hook-lib2to3.py"...
43786 INFO: Loading module hook "hook-scipy.sparse.csgraph.py"...
43786 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
43786 INFO: Loading module hook "hook-pywintypes.py"...
44114 INFO: Loading module hook "hook-pythoncom.py"...
44474 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
44489 INFO: Import to be excluded not found: 'FixTk'
44489 INFO: Excluding import 'tkinter'
44489 INFO: Loading module hook "hook-xml.dom.domreg.py"...
44489 INFO: Loading module hook "hook-_tkinter.py"...
44755 INFO: checking Tree
44786 INFO: checking Tree
44802 INFO: Loading module hook "hook-pkg_resources.py"...
45458 INFO: Loading module hook "hook-scipy.special._ufuncs.py"...
45458 INFO: Loading module hook "hook-sklearn.metrics.cluster.py"...
45458 WARNING: Hidden import "sklearn.utils.sparsetools._graph_validation" not found!
45458 WARNING: Hidden import "sklearn.utils.sparsetools._graph_tools" not found!
45458 INFO: Loading module hook "hook-encodings.py"...
45645 INFO: Loading module hook "hook-jedi.py"...
45770 INFO: Loading module hook "hook-matplotlib.backends.py"...
46739 INFO:   Matplotlib backend "GTK3Agg": ignored
    The GTK3 backends require PyGObject or pgi
47348 INFO:   Matplotlib backend "GTK3Cairo": ignored
    The GTK3 backends require PyGObject or pgi
47941 INFO:   Matplotlib backend "MacOSX": ignored
    cannot import name '_macosx'
48941 INFO:   Matplotlib backend "nbAgg": added
49550 INFO:   Matplotlib backend "Qt4Agg": added
50191 INFO:   Matplotlib backend "Qt4Cairo": added
50847 INFO:   Matplotlib backend "Qt5Agg": added
51487 INFO:   Matplotlib backend "Qt5Cairo": added
52128 INFO:   Matplotlib backend "TkAgg": added
52737 INFO:   Matplotlib backend "TkCairo": added
53581 INFO:   Matplotlib backend "WebAgg": added
54206 INFO:   Matplotlib backend "WX": added
54862 INFO:   Matplotlib backend "WXAgg": added
55518 INFO:   Matplotlib backend "WXCairo": added
56033 INFO:   Matplotlib backend "agg": added
56533 INFO:   Matplotlib backend "cairo": added
57205 INFO:   Matplotlib backend "pdf": added
57752 INFO:   Matplotlib backend "pgf": added
58220 INFO:   Matplotlib backend "ps": added
58658 INFO:   Matplotlib backend "svg": added
59314 INFO:   Matplotlib backend "template": added
60017 INFO: Loading module hook "hook-pytz.py"...
60079 INFO: Loading module hook "hook-setuptools.py"...
60142 INFO: Loading module hook "hook-pygments.py"...
62126 INFO: Loading module hook "hook-PyQt5.QtSvg.py"...
62407 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
62594 INFO: Loading module hook "hook-pydoc.py"...
62594 INFO: Loading module hook "hook-scipy.special._ellip_harm_2.py"...
62594 INFO: Loading module hook "hook-scipy.io.matlab.py"...
62594 INFO: Loading module hook "hook-xml.py"...
62594 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
62875 INFO: Loading module hook "hook-distutils.py"...
63063 INFO: Looking for ctypes DLLs
63188 INFO: Analyzing run-time hooks ...
63204 INFO: Including run-time hook 'pyi_rth__tkinter.py'
63204 INFO: Including run-time hook 'pyi_rth_traitlets.py'
63204 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
63204 INFO: Including run-time hook 'pyi_rth_mpldata.py'
63204 INFO: Including run-time hook 'pyi_rth_pyqt5.py'
63219 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
63219 INFO: Including run-time hook 'pyi_rth_pkgres.py'
63219 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
63266 INFO: Looking for dynamic libraries
65812 INFO: Looking for eggs
65812 INFO: Using Python library c:\users\thinkpad\appdata\local\programs\python\python35\python35.dll
65812 INFO: Found binding redirects:
[]
65922 INFO: Warnings written to C:\Users\ThinkPad\Desktop\py\build\cn35\warn-cn35.txt
66453 INFO: Graph cross-reference written to C:\Users\ThinkPad\Desktop\py\build\cn35\xref-cn35.html
66750 INFO: checking PYZ
66781 INFO: Building because toc changed
66781 INFO: Building PYZ (ZlibArchive) C:\Users\ThinkPad\Desktop\py\build\cn35\PYZ-00.pyz
71186 INFO: Building PYZ (ZlibArchive) C:\Users\ThinkPad\Desktop\py\build\cn35\PYZ-00.pyz completed successfully.
71295 INFO: checking PKG
71327 INFO: Building because toc changed
71327 INFO: Building PKG (CArchive) PKG-00.pkg
72623 WARNING: One binary added with two internal names.
72623 WARNING: ('libGLESv2.dll',
 'C:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\PyQt5\\Qt\\bin\\libGLESv2.dll',
 'BINARY')
72639 WARNING: was placed previously at
72639 WARNING: ('PyQt5\\Qt\\bin\\libGLESv2.dll',
 'C:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\PyQt5\\Qt\\bin\\libGLESv2.dll',
 'BINARY')
72686 WARNING: One binary added with two internal names.
72686 WARNING: ('libzmq.cp35-win_amd64.pyd',
 'c:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\zmq\\backend\\cython\\libzmq.cp35-win_amd64.pyd',
 'BINARY')
72686 WARNING: was placed previously at
72686 WARNING: ('zmq\\backend\\cython\\libzmq.cp35-win_amd64.pyd',
 'c:\\users\\thinkpad\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\zmq\\backend\\cython\\libzmq.cp35-win_amd64.pyd',
 'EXTENSION')
103335 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
103475 INFO: Bootloader c:\users\thinkpad\appdata\local\programs\python\python35\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
103475 INFO: checking EXE
103507 INFO: Building because manifest changed
103507 INFO: Building EXE from EXE-00.toc
103522 INFO: Appending archive to EXE C:\Users\ThinkPad\Desktop\py\dist\cn35.exe
103757 INFO: Building EXE from EXE-00.toc completed successfully.

 

 

所有的一切,都是为了让你不要再重蹈我走过的坑。。。。。。。

3,信号与槽:https://www.twblogs.net/a/5b7ef7822b717767c6acef4f/zh-cn

 

4, 兼容性问题:在WIN10 64位 系统 打包的只能运行在win10 64位系统上

你可能感兴趣的:(学习笔记,Python)