在 Linux 上将 bbfreeze 与 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>
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
这是必要的版本信息:
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenGL
>>> OpenGL.__version__
'3.0.1b2'
>>> import bbfreeze
>>> bbfreeze.version
(0, 97, 3)
我试图在冻结它的同一台计算机上运行它,并且未冻结的应用程序在该计算机上运行良好。
有人设法使这项工作成功吗?或者也许提供一些调试指导?
I have this pyopengl application and I'm trying to freeze it with bbfreeze. Unfortunately when I run the frozen app it errors with this:
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
Here's the requisite version information:
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenGL
>>> OpenGL.__version__
'3.0.1b2'
>>> import bbfreeze
>>> bbfreeze.version
(0, 97, 3)
I'm trying to run it on the same machine I'm freezing it on, and the unfrozen app runs fine on that machine.
Has anyone managed to make this work? or perhaps provide some debugging guidance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将“OpenGL.platform.glx”显式添加到冻结中包含的模块列表中。我认为 bbfreeze 选项“包含”就是您想要的。
更新:看看 PyInstaller 的工作方式:http://www.pyinstaller.org/browser/trunk/PyInstaller/hooks/hook-OpenGL.py
您可能需要将所有这些模块添加到您的包含列表中。
Try explicitly adding "OpenGL.platform.glx" to the list of included modules in the freeze. I think the bbfreeze option "includes" is what you want.
Update: take a look at the way PyInstaller does it: http://www.pyinstaller.org/browser/trunk/PyInstaller/hooks/hook-OpenGL.py
You will probably need to add all of these modules to your list of includes.
我也面临同样的挑战,直到我阅读文档,其中指出:
所以我认为最好的办法是使用提到的 python 版本!希望这有帮助!
I am also facing the same challenge until I read the documention, which states that:
So i think the best to do is to use the versions of python mentioned! Hope this helps!