Trimesh的show方法返回AttributeError错误。

3
我正在使用Python trimesh库来处理和分析三角网格。 调用show()方法会返回AttributeError错误:
import trimesh
mesh = trimesh.load_mesh("myfile.stl")
mesh.show()

Traceback (most recent call last):
  File "/Users/cg/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-cbb52bec63cc>", line 1, in <module>
    mesh.show()
  File "/Users/cg/anaconda/lib/python2.7/site-packages/trimesh/base.py", line 1339, in show
    scene.show(**kwargs)
  File "/Users/cg/anaconda/lib/python2.7/site-packages/trimesh/scene/scene.py", line 383, in show
    viewer()
  File "/Users/cg/anaconda/lib/python2.7/site-packages/trimesh/scene/scene.py", line 380, in viewer
    SceneViewer(self, **kwargs)
  File "/Users/cg/anaconda/lib/python2.7/site-packages/trimesh/scene/viewer.py", line 31, in __init__
    self.reset_view(flags=flags)
  File "/Users/cg/anaconda/lib/python2.7/site-packages/trimesh/scene/viewer.py", line 125, in reset_view
    if (self.width is not None and
  File "/Users/cg/anaconda/lib/python2.7/site-packages/pyglet/window/__init__.py", line 850, in <lambda>
    width = property(lambda self: self.get_size()[0],
  File "/Users/cg/anaconda/lib/python2.7/site-packages/pyglet/window/cocoa/__init__.py", line 398, in get_size
    window_frame = self._nswindow.frame()
AttributeError: 'NoneType' object has no attribute 'frame'

我正在使用Python 2.7.11和OSX 10.11。有人遇到过类似的问题吗?


你能否提供完整的堆栈跟踪信息,但不要在某个奇怪的IDE中运行吗?因为这是一个Pyglet错误 - 当然,但很可能是因为trimesh以某种方式以错误的顺序初始化了某些内容。因此,我想要trimesh的堆栈跟踪信息,以便查明错误的来源。 - Torxed
谢谢您的帮助,我更新了我的帖子以显示完整的trimesh堆栈跟踪。 - Colin
我遇到了同样的问题,也在寻找解决方案。如果我找到了解决方案,我会发布一个答案。 - Reb.Cabin
经过几个小时的调试,我放弃了并在 https://github.com/mikedh/trimesh/issues/61 上向所有者提出了问题。 - Reb.Cabin
1个回答

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接