Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NameError: name 'trimesh' is not defined" on M3 Mac #90

Closed
zixinz990 opened this issue Dec 19, 2024 · 13 comments
Closed

"NameError: name 'trimesh' is not defined" on M3 Mac #90

zixinz990 opened this issue Dec 19, 2024 · 13 comments

Comments

@zixinz990
Copy link

Tried several examples, but kept getting this error. For examples, when I ran Beyond Rigid Bodies, I got:

objc[3175]: Class GLFWHelper is implemented in both /opt/homebrew/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x147e08570) and /opt/homebrew/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x17ec6d7c0). One of the two will be used. Which one is undefined.
objc[3175]: Class GLFWApplicationDelegate is implemented in both /opt/homebrew/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x147e085c0) and /opt/homebrew/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x17ec6d810). One of the two will be used. Which one is undefined.
objc[3175]: Class GLFWWindowDelegate is implemented in both /opt/homebrew/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x147e085e8) and /opt/homebrew/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x17ec6d838). One of the two will be used. Which one is undefined.
objc[3175]: Class GLFWContentView is implemented in both /opt/homebrew/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x147e08638) and /opt/homebrew/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x17ec6d888). One of the two will be used. Which one is undefined.
objc[3175]: Class GLFWWindow is implemented in both /opt/homebrew/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x147e086b0) and /opt/homebrew/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x17ec6d900). One of the two will be used. Which one is undefined.
Failed to import pyrender. Rendering will not work.
[Genesis] [11:13:27] [INFO] ╭─────────────────────────────────────────────────────────────────────────────────────╮
[Genesis] [11:13:27] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉│
[Genesis] [11:13:27] [INFO] ╰─────────────────────────────────────────────────────────────────────────────────────╯
[Genesis] [11:13:28] [INFO] Running on [Apple M3] with backend gs.metal. Device memory: 16.00 GB.
[Genesis] [11:13:28] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: None, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'.
Traceback (most recent call last):
  File "/Users/zixinzhang/Documents/genesis_test.py", line 8, in <module>
    scene = gs.Scene(
            ^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/genesis/utils/misc.py", line 27, in new_init
    original_init(self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.12/site-packages/genesis/engine/scene.py", line 148, in __init__
    self._visualizer = Visualizer(
                       ^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/genesis/vis/visualizer.py", line 26, in __init__
    self._context = RasterizerContext(vis_options)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/genesis/vis/rasterizer_context.py", line 37, in __init__
    self.init_meshes()
  File "/opt/homebrew/lib/python3.12/site-packages/genesis/vis/rasterizer_context.py", line 52, in init_meshes
    self.link_frame_mesh = trimesh.creation.axis(origin_size=0.03, axis_radius=0.025, axis_length=1.0)
                           ^^^^^^^
NameError: name 'trimesh' is not defined

I am sure trimesh has been installed in my Python environment.

@pluti
Copy link

pluti commented Dec 19, 2024

I have the same issue. Seems to be "Pyrender" that can't handle OpenGL on Arm mac. Not sure how to solve it either ...
https://github.com/mmatl/pyrender/tree/master?tab=readme-ov-file

@miguelalonsojr
Copy link

Same issue on my end. :(

@miguelalonsojr
Copy link

on my M3, it seems to be related to not having ffmpeg installed. try

brew update
brew install ffmpeg

The hello, world example runs, but I can't see the render window. But at least there's no exception! :)

@robotlearning123
Copy link

M4 Mac, same issue...

@miguelalonsojr
Copy link

M4 Mac, same issue...

Try installing ffmpeg. Worked for me.

@miguelalonsojr
Copy link

Figured out why the viewer didn't show up. Got this message:

[Genesis] [15:06:37] [WARNING] Non-linux system detected. In order to use the interactive viewer, you need to manually run simulation in a separate thread and then start viewer. See `examples/render_on_macos.py`

For macs, the viewer needs to be run on a separate thread.

@iandanforth
Copy link

Figured out why the viewer didn't show up. Got this message:

[Genesis] [15:06:37] [WARNING] Non-linux system detected. In order to use the interactive viewer, you need to manually run simulation in a separate thread and then start viewer. See `examples/render_on_macos.py`

For macs, the viewer needs to be run on a separate thread.

Running this example script on Mac M4 results in the same error so this is not a general solution

@miguelalonsojr
Copy link

Hmmm. It's working for me with examples/render_on_macos.py. Did you install ffmpeg?

@RobRoyce
Copy link
Contributor

Check #26

Duplicate of #32

@miguelalonsojr
Copy link

Check #26

Duplicate of #32

Lol, wish I would have seen this earlier. Took me a bit to figure it out. Thanks!

@miguelalonsojr
Copy link

@iandanforth I'm on an M3 mac though... and I'm using the gs.metal backend for the example. Not sure if that matters. Also, see #27. For more details.

@YutoYasunaga
Copy link

You can try this. It works for me, I'm using M1 Mac.

#36 (comment)

@futuyao
Copy link

futuyao commented Dec 20, 2024

Same issue. Fixed by installing pyrender.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants