Python 在linux上使用bbfreeze和pyopengl应用程序

Python 在linux上使用bbfreeze和pyopengl应用程序,python,freeze,pyopengl,Python,Freeze,Pyopengl,我有这个pyopengl应用程序,我正试图用bbfreeze冻结它。不幸的是,当我运行冻结的应用程序时,它会出现以下错误: Traceback (most recent call last): File "<string>", line 6, in <module> File "__main__.py", line 128, in <module> File "__main__client__.py", line 11, in <module

我有这个pyopengl应用程序,我正试图用bbfreeze冻结它。不幸的是,当我运行冻结的应用程序时,它会出现以下错误:

Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "__main__.py", line 128, in <module>
  File "__main__client__.py", line 11, in <module>
  File "ui.py", line 15, in <module>
  File "OpenGL/GLUT/__init__.py", line 2, in <module>
  File "OpenGL/raw/GLUT/__init__.py", line 6, in <module>
  File "OpenGL/raw/GLUT/constants.py", line 7, in <module>
  File "OpenGL/platform/__init__.py", line 36, in <module>
  File "OpenGL/platform/__init__.py", line 27, in _load
  File "OpenGL/plugins.py", line 14, in load
  File "OpenGL/plugins.py", line 28, in importByName
ImportError: No module named glx
我正试图在冻结它的同一台机器上运行它,而未冻结的应用程序在这台机器上运行良好

有人能做到这一点吗?或者提供一些调试指导?

尝试显式地将“OpenGL.platform.glx”添加到冻结中包含的模块列表中。我认为bbfreeze选项“包括”是您想要的

更新:看看PyInstaller的工作方式:


您可能需要将所有这些模块添加到您的包含列表中。

在阅读文档之前,我也面临着同样的挑战,其中说明:

 bbfreeze has been tested with python 2.4, 2.5 and 2.6. bbfreeze will not work with python versions prior to 2.3 as it uses the zipimport feature introduced with python 2.3.

所以我认为最好的方法是使用前面提到的python版本!希望这有帮助

我设法让cxfreeze冻结同一个应用程序,但它会产生相同的错误(尽管格式不同)。我确实需要其他应用程序,但Numarays除外,我似乎没有。将这些添加到include确实解决了我的问题,谢谢。对于OpenGL.arrays.*模块的列表,我使用以下脚本:
For f in$(setopt extended_glob;ls$(python3-c“import OpenGL;print(OpenGL.\uuu path_uuuuuuu[0])/arrays/*.py grep-v_uuinit);do m=“${f##*/}”;echo-n,OpenGL.array.“${m%.py*}”;完成
 bbfreeze has been tested with python 2.4, 2.5 and 2.6. bbfreeze will not work with python versions prior to 2.3 as it uses the zipimport feature introduced with python 2.3.