- 找不到依赖包
> pyinstaller -F protion.py
PyInstaller cannot check for assembly dependencies.
Please install pywin32-ctypes.
pip install pywin32-ctypes
- 根据提示安装pywin32-ctypes
> pip install pywin32-ctypes
Looking in indexes: http://pypi.douban.com/simple
Requirement already satisfied: pywin32-ctypes in c:\users\thinkpad\appdata\local\programs\python\python38-32\lib\site-packages (0.2.0)
- 解决方法一:未解决 待补充
# python安装模块路径进入Lib/site-packages/Pyinstaller中找到compat.py文件
示例:C:\Users\ThinkPad\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\PyInstaller compat.py
# 打开文件搜索 win32ctypes
if is_win:
try:
from win32ctypes.pywin32 import pywintypes # noqa: F401
from win32ctypes.pywin32 import win32api
except ImportError:
# This environment variable is set by setup.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-ctypes.\n\n'
'pip install pywin32-ctypes\n')
将原有的:
from win32ctypes.pywin32 import pywintypes # noqa: F401
from win32ctypes.pywin32 import win32api
修改为:
#from win32ctypes.pywin32 import pywintypes # noqa: F401
#from win32ctypes.pywin32 import win32api
import pywintypes
import win32api
- 解决方法二:
# 查看已安装需要升级的模块
> pip list -o
# 如果存在新版本 便升级模块
> pip install --upgrade pyinstaller
> pip install --upgrade pyinstaller-hooks-contrib
> pip install --upgrade pygame
# 升级陈宫运行 打包扔报错的话 按照方法一再重新配置一下