首页 > 解决方案 > 无法打开文件映射对象错误?

问题描述

我的问题是我想将我的 python 模块打包到一个 exe 文件中。但我一直收到

D:\Python test>pyinstaller -F make.py
Could not open file mapping object (2).
66 INFO: PyInstaller: 3.5
67 INFO: Python: 3.6.8
68 INFO: Platform: Windows-10-10.0.17763-SP0
69 INFO: wrote D:\Python test\make.spec
70 INFO: UPX is not available.
71 INFO: Extending PYTHONPATH with paths
['D:\\Python test', 'D:\\Python test']
72 INFO: checking Analysis
72 INFO: Building Analysis because Analysis-00.toc is non existent
72 INFO: Initializing module dependency graph...
91 INFO: Initializing module graph hooks...
99 INFO: Analyzing base_library.zip ...
2497 INFO: running Analysis Analysis-00.toc
2499 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by d:\python36\python.exe
2839 INFO: Caching module hooks...
2843 INFO: Analyzing D:\Python test\make.py
3870 INFO: Processing pre-find module path hook   distutils
4586 INFO: Processing pre-find module path hook   site
4587 INFO: site: retargeting to fake-dir 'd:\\python36\\lib\\site-packages\\PyInstaller\\fake-modules'
5542 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
6645 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
7816 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
10273 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
11408 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
12516 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
15474 INFO: Processing pre-safe import module hook   win32com
15783 INFO: Loading module hooks...
15783 INFO: Loading module hook "hook-distutils.py"...
15785 INFO: Loading module hook "hook-encodings.py"...
15879 INFO: Loading module hook "hook-lib2to3.py"...
15883 INFO: Loading module hook "hook-lxml.etree.py"...
15884 INFO: Loading module hook "hook-numpy.core.py"...
16087 INFO: Loading module hook "hook-numpy.py"...
16088 INFO: Loading module hook "hook-openpyxl.py"...
16095 INFO: Loading module hook "hook-PIL.Image.py"...
16432 INFO: Loading module hook "hook-PIL.py"...
16434 INFO: Excluding import 'PySide'
16436 INFO:   Removing import of PySide from module PIL.ImageQt
16436 INFO: Excluding import 'PyQt4'
16438 INFO:   Removing import of PyQt4 from module PIL.ImageQt
16439 INFO: Excluding import 'PyQt5'
16441 INFO:   Removing import of PyQt5 from module PIL.ImageQt
16442 INFO: Import to be excluded not found: 'FixTk'
16442 INFO: Excluding import 'tkinter'
16445 INFO:   Removing import of tkinter from module PIL.ImageTk
16446 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
16448 INFO: Excluding import 'tkinter'
16449 INFO: Import to be excluded not found: 'FixTk'
16449 INFO: Loading module hook "hook-pkg_resources.py"...
17591 WARNING: Hidden import "object" not found!
17592 WARNING: Hidden import "file" not found!
17624 WARNING: Hidden import "not" not found!
17775 WARNING: Hidden import "Could" not found!
17777 WARNING: Hidden import "open" not found!
17778 WARNING: Hidden import "mapping" not found!
17797 WARNING: Hidden import "(2)." not found!
17798 INFO: Loading module hook "hook-pydoc.py"...
17799 INFO: Loading module hook "hook-pythoncom.py"...
Unable to find "d:\python36\pythoncom36.dll
Could not open file mapping object (2)." when adding binary and data files.

然后我尝试使用 cmd: python myscript.py 执行我的 python 模块,然后它显示相同的警告,但我仍然可以正常工作:

无法打开文件映射对象(2)

我认为我的 pyinstaller 错误与警告有关,但我该如何解决呢?

标签: pythonpyinstaller

解决方案


推荐阅读