在 Linux 上将 bbfreeze 与 pyopengl 应用程序结合使用

发布于 2024-11-04 12:54:10 字数 1186 浏览 0 评论 0原文

我有这个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冰魂雪魄 2024-11-11 12:54:10

尝试将“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.

一身软味 2024-11-11 12:54:10

我也面临同样的挑战,直到我阅读文档,其中指出:

 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 版本!希望这有帮助!

I am also facing the same challenge until I read the documention, which states that:

 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.

So i think the best to do is to use the versions of python mentioned! Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文