如果您使用的是 Python 2.7,则需要将 C:/Python27/Lib/site-packages/PyInstaller 文件中的 compat.py 更改为:
if is_win:
try:
#from win32ctypes.pywin32 import pywintypes # noqa: F401
#from win32ctypes.pywin32 import win32api
import pywintypes
import win32api
except ImportError:
# This environment variable is set by seutp.py
# - It's not an error for pywin32 to not be installed at that point
if not os.environ.get('PYINSTALLER_NO_PYWIN32_FAILURE'):
raise SystemExit('PyInstaller cannot check for assembly dependencies.\n'
'Please install PyWin32 or pywin32-ctypes.\n\n'
'pip install pypiwin32\n')
为了工作。