pyinstaller错误:ImportError: cannot import name ‘opengl_arrays_modules’ from ‘PyInstaller.utils.hooks’
在使用pyinstaller打包python工程时,python程序中使用了OpenGL的库,使用命令
pyinstaller -F xxx.py
报错
ImportError: cannot import name 'opengl_arrays_modules' from 'PyInstaller.utils.hooks'
在网上查找资料后,这是因为之前老旧的pyinstaller-hooks-contrib文件没有对OpenGL提供支持,所以只需要在命令行中更新这个文件就可以了
pip install -U pyinstaller-hooks-contrib
之后直接使用pyinstaller打包即可。