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

mjpython on MacOS does not support other 3rd party packages #2505

Open
2 tasks done
Fima2003 opened this issue Mar 17, 2025 · 2 comments
Open
2 tasks done

mjpython on MacOS does not support other 3rd party packages #2505

Fima2003 opened this issue Mar 17, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@Fima2003
Copy link

Fima2003 commented Mar 17, 2025

Intro

Hi!

I am an undergrad student at Technion, I use MuJoCo for my research on Robotic arms.

My setup

I am using MuJoCo on python on Mac(M-series chip) with Sequoia 15.3.2, and I cannot import not pre-built packages when running with mjpython

What's happening? What did you expect?

Well, I expected it to run, but it does not

Steps for reproduction

  1. Load the package below.
    pip3 install mink
  2. Run the code below.(with mjpython setup.py)
import mujoco
import mink
import numpy as np


def setup():
    XML_PATH = "ur5e_scene.xml"
    model = mujoco.MjModel.from_xml_path(XML_PATH)
    data = mujoco.MjData(model)

    key_name = "home"
    key_id = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_KEY, key_name)
    if key_id >= 0:
        data.qpos[:] = model.key_qpos[key_id].copy()
        data.ctrl[:] = model.key_ctrl[key_id].copy()

    # Make sure the state is updated:
    mujoco.mj_forward(model, data)

    return model, data

if __name__ == "__main__":
    setup()
  1. See the error
Traceback (most recent call last):
  File "/universal_robots_ur5e/setup.py", line 2, in <module>
    import mink
ModuleNotFoundError: No module named 'mink'

Minimal model for reproduction

The model is not that relevant, to be honest, but for argument's sake, you can use the default one:

minimal XML
<mujoco>
  <worldbody>
    <light pos="0 0 1"/>
    <geom type="sphere" size="1" rgba="1 0 0 1"/>
  </worldbody>
</mujoco>

Code required for reproduction

import mujoco
import mink
import numpy as np


def setup():
    XML_PATH = "ur5e_scene.xml"
    model = mujoco.MjModel.from_xml_path(XML_PATH)
    data = mujoco.MjData(model)

    key_name = "home"
    key_id = mujoco.mj_name2id(model, mujoco.mjtObj.mjOBJ_KEY, key_name)
    if key_id >= 0:
        data.qpos[:] = model.key_qpos[key_id].copy()
        data.ctrl[:] = model.key_ctrl[key_id].copy()

    # Make sure the state is updated:
    mujoco.mj_forward(model, data)

    return model, data

if __name__ == "__main__":
    setup()

Confirmations

@Fima2003 Fima2003 added the bug Something isn't working label Mar 17, 2025
@yuvaltassa
Copy link
Collaborator

Did you ask on the mink repo?

cc @kevinzakka

@Fima2003
Copy link
Author

@yuvaltassa this is not mink related issue as the rest of the 3rd party packages are also not loading. Should have mentioned that in the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants