pyinstaller -F 打包异常
异常信息
2014 INFO: PyInstaller: 4.5.1
2014 INFO: Python: 3.8.8 (conda)
2015 INFO: Platform: Windows-10-10.0.17763-SP0
2016 INFO: wrote E:\Code\invitation-master\card.spec
2018 INFO: UPX is not available.
2022 INFO: Extending PYTHONPATH with paths
['E:\\Code\\invitation-master', 'E:\\Code\\invitation-master']
2699 INFO: checking Analysis
2699 INFO: Building Analysis because Analysis-00.toc is non existent
2699 INFO: Initializing module dependency graph...
2704 INFO: Caching module graph hooks...
2723 INFO: Analyzing base_library.zip ...
9318 INFO: Processing pre-find module path hook distutils from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
9319 INFO: distutils: retargeting to non-venv dir 'c:\\programdata\\anaconda3\\lib'
14373 INFO: Caching module dependency graph...
14685 INFO: running Analysis Analysis-00.toc
14709 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executablerequired by c:\programdata\anaconda3\python.exe
15049 INFO: Analyzing E:\Code\invitation-master\card.py
17545 INFO: Processing pre-find module path hook site from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
17546 INFO: site: retargeting to fake-dir 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\fake-modules'
42802 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
53039 INFO: Processing pre-safe import module hook six.moves from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
68757 INFO: Processing pre-safe import module hook win32com from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
79299 INFO: Processing module hooks...
79299 INFO: Loading module hook 'hook-appdirs.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
79308 INFO: Loading module hook 'hook-bcrypt.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
79309 INFO: Loading module hook 'hook-certifi.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
79315 INFO: Loading module hook 'hook-cryptography.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
79651 INFO: Loading module hook 'hook-docutils.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
82756 INFO: Loading module hook 'hook-IPython.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
83646 INFO: Loading module hook 'hook-jedi.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85488 INFO: Loading module hook 'hook-jinja2.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85511 INFO: Loading module hook 'hook-jsonschema.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85540 INFO: Loading module hook 'hook-nacl.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85566 INFO: Loading module hook 'hook-nbconvert.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85723 INFO: Loading module hook 'hook-nbformat.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85792 INFO: Loading module hook 'hook-notebook.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
90426 INFO: Loading module hook 'hook-parso.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
90446 INFO: Loading module hook 'hook-pycparser.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
90449 INFO: Loading module hook 'hook-pytest.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
92253 INFO: Loading module hook 'hook-pythoncom.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
93045 INFO: Loading module hook 'hook-pywintypes.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
93824 INFO: Loading module hook 'hook-regex.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
93825 INFO: Loading module hook 'hook-win32com.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
c:\programdata\anaconda3\lib\site-packages\win32com\client\makepy.py:369: SyntaxWarning: "is not" with a literal. Did you mean "!="?if path is not '' and not os.path.exists(path):
94853 INFO: Loading module hook 'hook-zmq.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
97586 INFO: Loading module hook 'hook-babel.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
97793 INFO: Loading module hook 'hook-difflib.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
97802 INFO: Loading module hook 'hook-distutils.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
97803 INFO: Loading module hook 'hook-distutils.util.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
97812 INFO: Loading module hook 'hook-encodings.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
97927 INFO: Loading module hook 'hook-gevent.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
98615 INFO: Determining a mapping of distributions to packages...
200658 WARNING: Unable to find package for requirement zope.interface from package gevent.
200658 WARNING: Unable to find package for requirement zope.event from package gevent.
200659 INFO: Packages required by gevent:
['greenlet', 'setuptools', 'cffi']
202578 INFO: Loading module hook 'hook-heapq.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
202588 INFO: Loading module hook 'hook-importlib_metadata.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
202591 INFO: Loading module hook 'hook-lib2to3.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
202641 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
203420 INFO: Matplotlib backend "GTK3Agg": ignoredbackend Gtk3Agg requires cairo
203810 INFO: Matplotlib backend "GTK3Cairo": ignoredcairo backend requires that pycairo>=1.11.0 or cairocffiis installed
204203 INFO: Matplotlib backend "MacOSX": ignoredcannot import name '_macosx' from 'matplotlib.backends' (c:\programdata\anaconda3\lib\site-packages\matplotlib\backends\__init__.py)
205393 INFO: Matplotlib backend "nbAgg": added
<string>:12: MatplotlibDeprecationWarning:
The matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
205974 INFO: Matplotlib backend "Qt4Agg": added
206356 INFO: Matplotlib backend "Qt4Cairo": ignoredcairo backend requires that pycairo>=1.11.0 or cairocffiis installed
206924 INFO: Matplotlib backend "Qt5Agg": added
207315 INFO: Matplotlib backend "Qt5Cairo": ignoredcairo backend requires that pycairo>=1.11.0 or cairocffiis installed
208034 INFO: Matplotlib backend "TkAgg": added
208701 INFO: Matplotlib backend "TkCairo": ignoredcairo backend requires that pycairo>=1.11.0 or cairocffiis installed
209379 INFO: Matplotlib backend "WebAgg": added
210024 INFO: Matplotlib backend "WX": ignoredNo module named 'wx'
210409 INFO: Matplotlib backend "WXAgg": ignoredNo module named 'wx'
210787 INFO: Matplotlib backend "WXCairo": ignoredNo module named 'wx'
211258 INFO: Matplotlib backend "agg": added
211651 INFO: Matplotlib backend "cairo": ignoredcairo backend requires that pycairo>=1.11.0 or cairocffiis installed
212303 INFO: Matplotlib backend "pdf": added
212957 INFO: Matplotlib backend "pgf": added
213440 INFO: Matplotlib backend "ps": added
213939 INFO: Matplotlib backend "svg": added
214577 INFO: Matplotlib backend "template": added
215288 INFO: Loading module hook 'hook-matplotlib.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
215684 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
215693 INFO: Loading module hook 'hook-numpy.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
215851 INFO: Import to be excluded not found: 'f2py'
215851 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
215863 INFO: Loading module hook 'hook-packaging.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
215864 INFO: Loading module hook 'hook-pickle.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
215875 INFO: Loading module hook 'hook-PIL.Image.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
216637 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
216647 INFO: Loading module hook 'hook-PIL.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
216685 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
216695 INFO: Loading module hook 'hook-pkg_resources.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
217923 WARNING: Hidden import "pkg_resources.py2_warn" not found!
217924 WARNING: Hidden import "pkg_resources.markers" not found!
217935 INFO: Loading module hook 'hook-pygments.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
220682 INFO: Loading module hook 'hook-PyQt5.py' from 'c:\\programdata\\anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
Traceback (most recent call last):File "c:\programdata\anaconda3\lib\runpy.py", line 194, in _run_module_as_mainreturn _run_code(code, main_globals, None,File "c:\programdata\anaconda3\lib\runpy.py", line 87, in _run_codeexec(code, run_globals)File "C:\ProgramData\Anaconda3\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 126, in runrun_build(pyi_config, spec_file, **vars(args))File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 65, in run_buildPyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 815, in mainbuild(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 762, in buildexec(code, spec_namespace)File "E:\Code\invitation-master\card.spec", line 7, in <module>a = Analysis(['card.py'],File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 294, in __init__self.__postinit__()File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\building\datastruct.py", line 159, in __postinit__self.assemble()File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 473, in assembleself.graph.process_post_graph_hooks(self)File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\depend\analysis.py", line 373, in process_post_graph_hooksmodule_hook.post_graph(analysis)File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\depend\imphook.py", line 451, in post_graphself._load_hook_module()File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\depend\imphook.py", line 408, in _load_hook_moduleself._hook_module = importlib_load_source(File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\compat.py", line 632, in importlib_load_sourcereturn mod_loader.load_module()File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapperFile "<frozen importlib._bootstrap_external>", line 962, in load_moduleFile "<frozen importlib._bootstrap_external>", line 787, in load_moduleFile "<frozen importlib._bootstrap>", line 265, in _load_module_shimFile "<frozen importlib._bootstrap>", line 702, in _loadFile "<frozen importlib._bootstrap>", line 671, in _load_unlockedFile "<frozen importlib._bootstrap_external>", line 783, in exec_moduleFile "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removedFile "c:\programdata\anaconda3\lib\site-packages\PyInstaller\hooks\hook-PyQt5.py", line 11, in <module>from PyInstaller.utils.hooks.qt import pyqt5_library_info, \File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\utils\hooks\qt.py", line 162, in <module>pyqt5_library_info = QtLibraryInfo('PyQt5')File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\utils\hooks\qt.py", line 54, in __init__if hooks.is_module_satisfies("PyQt5 >= 5.15.4"):File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 502, in is_module_satisfiesversion = get_module_attribute(module_name, version_attr)File "c:\programdata\anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 352, in get_module_attributeraise AttributeError(
AttributeError: Module 'PyQt5' has no attribute '__version__'
原因
未知
解决方案
pip安装PyQt5时 加入参数 --user
pip install PyQt5 --user