pyinstaller<ImportError: cannot import name 'Sequence' from 'collections'>

问题描述 投票:0回答:1

环境

  • 窗口10
  • Spyder IDE 5.4.3
  • Python 3.11.5 64 位
  • pyinstaller 5.6.2

当我为我的代码运行 pyinstaller 时,我得到了下面的回溯。

我想知道为什么我会遇到这个令人绝望的问题以及如何解决它。

我在这里搜索了类似的问题(ref1ref2)但不是相同的情况。

任何评论都会对我有帮助=)

> pyinstaller main.spec
4087 INFO: PyInstaller: 5.6.2
4088 INFO: Python: 3.11.5 (conda)
4106 INFO: Platform: Windows-10-10.0.22621-SP0
4112 INFO: UPX is not available.
4115 INFO: Extending PYTHONPATH with paths
['C:\\Users\\dazzling\\Documents\\wxPython\\Project001']
6382 INFO: checking Analysis
6483 INFO: Building because Analysis-00.toc is bad
6483 INFO: Initializing module dependency graph...
6490 INFO: Caching module graph hooks...
6503 WARNING: Several hooks defined for module 'numpy'. Please take care they do not conflict.
6527 INFO: Analyzing base_library.zip ...
23658 INFO: Loading module hook 'hook-heapq.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
23977 INFO: Loading module hook 'hook-encodings.py' from 'same folder(to save letters)'...
31812 INFO: Loading module hook 'hook-pickle.py' from 'Same folder(to save letters)'...
35817 INFO: Caching module dependency graph...
35986 INFO: running Analysis Analysis-00.toc
36005 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by C:\ProgramData\anaconda3\python.exe
36305 INFO: Analyzing C:\Users\dazzling\Documents\wxPython\Project001\main.py
37125 INFO: Loading module hook 'hook-pandas.py' from 'Same folder(to save letters)'...
4022 INFO: NumExpr defaulting to 8 threads.
43561 INFO: Loading module hook 'hook-platform.py' from 'Same folder(to save letters)'...
43765 INFO: Loading module hook 'hook-numpy.py' from 'Same folder(to save letters)'...
45683 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'Same folder(to save letters)'...
47035 INFO: Loading module hook 'hook-difflib.py' from 'Same folder(to save letters)'...
48000 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'Same folder(to save letters)'...
48739 INFO: Loading module hook 'hook-xml.py' from 'Same folder(to save letters)'...
50665 INFO: Loading module hook 'hook-sysconfig.py' from 'Same folder(to save letters)'...
51602 INFO: Loading module hook 'hook-psutil.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
52081 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'Same folder(to save letters)'...
55567 INFO: Loading module hook 'hook-pytz.py' from 'Same folder(to save letters)'...
56568 INFO: Loading module hook 'hook-pkg_resources.py' from 'Same folder(to save letters)'...
70135 INFO: Loading module hook 'hook-scipy.py' from 'Same folder(to save letters)'...
70483 INFO: Loading module hook 'hook-pytest.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
71593 INFO: Loading module hook 'hook-importlib_metadata.py' from 'Same folder(to save letters)'...
72245 INFO: Loading module hook 'hook-py.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
74482 INFO: Loading module hook 'hook-packaging.py' from 'Same folder(to save letters)'...
75103 INFO: Loading module hook 'hook-pygments.py' from 'Same folder(to save letters)'...
91269 INFO: Loading module hook 'hook-pycparser.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
92035 INFO: Processing pre-find module path hook distutils from 'Same folder(to save letters)\\pre_find_module_path\\hook-distutils.py'.
92587 INFO: Loading module hook 'hook-distutils.py' from 'Same folder(to save letters)'...
92664 INFO: Loading module hook 'hook-distutils.util.py' from 'Same folder(to save letters)'...
93287 INFO: Loading module hook 'hook-setuptools.py' from 'Same folder(to save letters)'...
105608 INFO: Loading module hook 'hook-matplotlib.py' from 'Same folder(to save letters)'...
106501 INFO: Processing pre-safe import module hook gi from 'Same folder(to save letters)\\pre_safe_import_module\\hook-gi.py'.
106861 INFO: Loading module hook 'hook-PIL.py' from 'Same folder(to save letters)'...
106970 INFO: Loading module hook 'hook-PIL.Image.py' from 'Same folder(to save letters)'...
111540 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'Same folder(to save letters)'...
112467 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'Same folder(to save letters)'...
113820 INFO: Loading module hook 'hook-jinja2.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
117010 INFO: Processing pre-safe import module hook six.moves from 'Same folder(to save letters)\\pre_safe_import_module\\hook-six.moves.py'.
120169 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'Same folder(to save letters)'...
122314 INFO: Loading module hook 'hook-IPython.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
127401 INFO: Loading module hook 'hook-lib2to3.py' from 'Same folder(to save letters)'...
131006 INFO: Loading module hook 'hook-wcwidth.py' from 'Same folder(to save letters)'...
134146 INFO: Loading module hook 'hook-jedi.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
137372 INFO: Loading module hook 'hook-parso.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
139178 INFO: Loading module hook 'hook-docutils.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
158796 INFO: Loading module hook 'hook-sphinx.py' from 'Same folder(to save letters)'...
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sphinx\application.py", line 27, in <module>
    from sphinx.environment import BuildEnvironment
  File "C:\ProgramData\anaconda3\Lib\site-packages\sphinx\environment\__init__.py", line 23, in <module>
    from sphinx.events import EventManager
  File "C:\ProgramData\anaconda3\Lib\site-packages\sphinx\events.py", line 13, in <module>
    from sphinx.util.inspect import safe_getattr
  File "C:\ProgramData\anaconda3\Lib\site-packages\sphinx\util\inspect.py", line 18, in <module>
    from sphinx.pycode.ast import ast  # for py36-37
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\anaconda3\Lib\site-packages\sphinx\pycode\__init__.py", line 11, in <module>
    from zipfile import ZipFile
  File "C:\ProgramData\anaconda3\Lib\zipfile.py", line 19, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
170496 INFO: Loading module hook 'hook-babel.py' from 'Same folder(to save letters)'...
176026 INFO: Loading module hook 'hook-sqlite3.py' from 'Same folder(to save letters)'...
181787 INFO: Loading module hook 'hook-nbformat.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
184320 INFO: Loading module hook 'hook-jsonschema.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
187445 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'Same folder(to save letters)\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
189434 INFO: Loading module hook 'hook-charset_normalizer.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
190786 INFO: Loading module hook 'hook-cryptography.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
206331 INFO: Loading module hook 'hook-bcrypt.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
206699 INFO: Loading module hook 'hook-certifi.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
209768 INFO: Loading module hook 'hook-platformdirs.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
212947 INFO: Loading module hook 'hook-zmq.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
220469 INFO: Loading module hook 'hook-nacl.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
220894 INFO: Loading module hook 'hook-pywintypes.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\__init__.py", line 45, in <module>
    import pkg_resources
  File "C:\ProgramData\anaconda3\Lib\site-packages\pkg_resources\__init__.py", line 26, in <module>
    import zipfile
  File "C:\ProgramData\anaconda3\Lib\zipfile.py", line 19, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
226320 INFO: Loading module hook 'hook-PyQt5.py' from 'Same folder(to save letters)'...
227613 INFO: Loading module hook 'hook-shelve.py' from 'Same folder(to save letters)'...
228653 INFO: Loading module hook 'hook-scipy.linalg.py' from 'Same folder(to save letters)'...
229636 INFO: Loading module hook 'hook-scipy.sparse.csgraph.py' from 'Same folder(to save letters)'...
238524 INFO: Loading module hook 'hook-scipy.spatial.transform.rotation.py' from 'Same folder(to save letters)'...
244054 INFO: Loading module hook 'hook-pandas.io.formats.style.py' from 'Same folder(to save letters)'...
246442 INFO: Loading module hook 'hook-pyarrow.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
252274 INFO: Loading module hook 'hook-pandas.plotting.py' from 'Same folder(to save letters)'...
253279 INFO: Loading module hook 'hook-numba.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
254597 INFO: Loading module hook 'hook-llvmlite.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
266641 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'.
266935 INFO: Loading module hook 'hook-win32com.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
266940 INFO: Loading module hook 'hook-pythoncom.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\__init__.py", line 45, in <module>
    import pkg_resources
  File "C:\ProgramData\anaconda3\Lib\site-packages\pkg_resources\__init__.py", line 26, in <module>
    import zipfile
  File "C:\ProgramData\anaconda3\Lib\zipfile.py", line 19, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
272414 INFO: Loading module hook 'hook-dask.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
276312 INFO: Loading module hook 'hook-lz4.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
276978 INFO: Loading module hook 'hook-h5py.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
279118 INFO: Loading module hook 'hook-bokeh.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
286785 INFO: Loading module hook 'hook-xyzservices.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
292186 INFO: Loading module hook 'hook-botocore.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
300354 INFO: Loading module hook 'hook-sqlalchemy.py' from 'Same folder(to save letters)'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 114, in <module>
    from importlib import metadata as importlib_metadata
  File "C:\ProgramData\anaconda3\Lib\importlib\metadata\__init__.py", line 7, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
300679 INFO: Loading module hook 'hook-sqlalchemy.py' from 'Same folder(to save letters)'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 114, in <module>
    from importlib import metadata as importlib_metadata
  File "C:\ProgramData\anaconda3\Lib\importlib\metadata\__init__.py", line 7, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
306795 INFO: Loading module hook 'hook-argon2.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
308651 INFO: Loading module hook 'hook-notebook.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
315631 INFO: Loading module hook 'hook-anyio.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
339212 INFO: Loading module hook 'hook-keyring.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
358028 INFO: Loading module hook 'hook-openpyxl.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
359093 INFO: Loading module hook 'hook-lxml.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
369250 INFO: Loading module hook 'hook-tables.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
370814 INFO: Loading module hook 'hook-sqlalchemy.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 114, in <module>
    from importlib import metadata as importlib_metadata
  File "C:\ProgramData\anaconda3\Lib\importlib\metadata\__init__.py", line 7, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
370962 INFO: Loading module hook 'hook-sqlalchemy.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 114, in <module>
    from importlib import metadata as importlib_metadata
  File "C:\ProgramData\anaconda3\Lib\importlib\metadata\__init__.py", line 7, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
371110 INFO: Loading module hook 'hook-sqlalchemy.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 114, in <module>
    from importlib import metadata as importlib_metadata
  File "C:\ProgramData\anaconda3\Lib\importlib\metadata\__init__.py", line 7, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
371267 INFO: Loading module hook 'hook-sqlalchemy.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 114, in <module>
    from importlib import metadata as importlib_metadata
  File "C:\ProgramData\anaconda3\Lib\importlib\metadata\__init__.py", line 7, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
371593 INFO: Loading module hook 'hook-sqlalchemy.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 114, in <module>
    from importlib import metadata as importlib_metadata
  File "C:\ProgramData\anaconda3\Lib\importlib\metadata\__init__.py", line 7, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
374661 INFO: Loading module hook 'hook-wx.xrc.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
375328 INFO: Processing module hooks...
378101 INFO: Loading module hook 'hook-lxml.etree.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
378555 INFO: Loading module hook 'hook-lxml.isoschematron.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
379387 WARNING: Hidden import "pyarrow.compat" not found!
380377 INFO: Loading module hook 'hook-zope.interface.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
385146 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
389411 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
389412 INFO: Matplotlib backend selection method: automatic discovery of used backends
389538 INFO: Selected matplotlib backends: ['WXAgg', 'WXAgg']
390435 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
395569 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
395766 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
396406 INFO: Loading module hook 'hook-scipy.special._ellip_harm_2.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
396408 INFO: Loading module hook 'hook-scipy.special._ufuncs.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
396410 INFO: Loading module hook 'hook-scipy.stats._stats.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
396453 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
404606 INFO: Loading module hook 'hook-sqlalchemy.py' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\PyInstaller\\hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\ProgramData\anaconda3\Lib\site-packages\sqlalchemy\util\compat.py", line 114, in <module>
    from importlib import metadata as importlib_metadata
  File "C:\ProgramData\anaconda3\Lib\importlib\metadata\__init__.py", line 7, in <module>
    import pathlib
  File "C:\ProgramData\anaconda3\Lib\site-packages\pathlib.py", line 10, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\ProgramData\anaconda3\Lib\collections\__init__.py)
Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\Scripts\pyinstaller-script.py", line 10, in <module>
    sys.exit(run())
             ^^^^^
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\__main__.py", line 179, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\__main__.py", line 60, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\building\build_main.py", line 963, in main
    build(specfile, distpath, workpath, clean_build)
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\building\build_main.py", line 885, in build
    exec(code, spec_namespace)
  File "main.spec", line 3, in <module>
    a = Analysis(
        ^^^^^^^^^
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\building\build_main.py", line 410, in __init__
    self.__postinit__()
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\building\datastruct.py", line 173, in __postinit__
    self.assemble()
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\building\build_main.py", line 579, in assemble
    self.graph.process_post_graph_hooks(self)
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\depend\analysis.py", line 329, in process_post_graph_hooks
    module_hook.post_graph(analysis)
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\depend\imphook.py", line 447, in post_graph
    self._load_hook_module(keep_module_ref=True)
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\depend\imphook.py", line 387, in _load_hook_module
    self._hook_module = importlib_load_source(self.hook_module_name, self.hook_filename)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\compat.py", line 609, in importlib_load_source
    return mod_loader.load_module()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 605, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1120, in load_module
  File "<frozen importlib._bootstrap_external>", line 945, in load_module
  File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 721, in _load
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\ProgramData\anaconda3\Lib\site-packages\PyInstaller\hooks\hook-sqlalchemy.py", line 31, in <module>
    dialects = eval(dialects.strip())
               ^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 0

SyntaxError: invalid syntax
wxpython pyinstaller
1个回答
0
投票

尝试

conda remove pathlib
conda uninstall pathlib
或任何 conda 命令来摆脱 pathlib。

pathlib 是 python3 stdlib 的一部分,但尝试导入的模块是可能非常旧的第 3 方模块。您需要从站点包中删除该库,以便当它读取导入语句时,它首先在标准模块中查找

© www.soinside.com 2019 - 2024. All rights reserved.