import MuJoCo, ImportError: cannot import name 'constants'
See original GitHub issueDear all: when I import MuJoCo, some error happen:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-7bf9adbdec98> in <module>()
----> 1 import dm_control.mujoco
/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/__init__.py in <module>()
16 """Mujoco implementations of base classes."""
17
---> 18 from dm_control.mujoco.engine import action_spec
19
20 from dm_control.mujoco.engine import Camera
/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/engine.py in <module>()
41
42 from dm_control import render
---> 43 from dm_control.mujoco import index
44
45 from dm_control.mujoco import wrapper
/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/index.py in <module>()
92 # Internal dependencies.
93
---> 94 from dm_control.mujoco.wrapper import util
95 from dm_control.mujoco.wrapper.mjbindings import sizes
96 import numpy as np
/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/wrapper/__init__.py in <module>()
21
22
---> 23 from dm_control.mujoco.wrapper import mjbindings
24
25 from dm_control.mujoco.wrapper.core import callback_context
/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/wrapper/mjbindings/__init__.py in <module>()
22 from absl import logging
23
---> 24 from dm_control.mujoco.wrapper.mjbindings import constants
25 from dm_control.mujoco.wrapper.mjbindings import enums
26 from dm_control.mujoco.wrapper.mjbindings import sizes
ImportError: cannot import name 'constants'
My python version is Python 3.5.3, and I use macOs sierra 10.12.6
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:19
Top Results From Across the Web
ImportError: cannot import name constants - python
It looks like you have two versions installed. Try starting over. Remove all pyzmq packages and re-install it (using pip or whatever). –...
Read more >ImportError: cannot import name 'constants' - Google Groups
You received this message because you are subscribed to the Google Groups "TRex Traffic Generator" group. To unsubscribe from this group and stop...
Read more >Python Bindings - MuJoCo Documentation
Once installed, the package can be imported via import mujoco . Structs, functions, constants, and enums are available directly from the top-level mujoco...
Read more >mujoco - PyPI
This package is the canonical Python bindings for the MuJoCo physics engine. ... Once installed, the package can be imported via import mujoco...
Read more >Installing MuJoCo to Work With OpenAI Gym Environments
In this article, I'll show you how to install MuJoCo on your Mac/Linux ... or running python3 -c 'import mujoco_py' then follow these...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Did you install making it editable? This gave me the same problem. In other words, this doesn’t work
while this does work
I tend to always use the former when trying out new libraries, so I can edit them and see how they work. However, if you make the library editable, it doesn’t seem to generate the needed mjbindings.
This happens if you “pip install” but then try to import the module form the github source dir. change to some other path than the github checkout and it will work.