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

pip install from git fails #210

Closed
ikostrikov opened this issue Oct 24, 2021 · 8 comments
Closed

pip install from git fails #210

ikostrikov opened this issue Oct 24, 2021 · 8 comments
Assignees
Labels

Comments

@ikostrikov
Copy link

I tested it on several machines in clean conda installations and got exactly the same error message. All machines run Ubuntu 20.04.

pip install git+git://github.com/deepmind/dm_control.git

fails with the following error message

ERROR: Command errored out with exit status 1:
     command: /home/kostrikov/miniconda3/envs/test/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-e4i_e72j/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-e4i_e72j/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-celpm6j2/install-record.txt --single-version-externally-managed --compile --install-headers /home/kostrikov/miniconda3/envs/test/include/python3.9/dm-control
         cwd: /tmp/pip-req-build-e4i_e72j/
    Complete output (41 lines):
    running install
    running build_mjbindings
    Traceback (most recent call last):
      File "/tmp/pip-req-build-e4i_e72j/dm_control/autowrap/autowrap.py", line 149, in <module>
        app.run(main)
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/site-packages/absl/app.py", line 312, in run
        _run_main(main, args)
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/site-packages/absl/app.py", line 258, in _run_main
        sys.exit(main(argv))
      File "/tmp/pip-req-build-e4i_e72j/dm_control/autowrap/autowrap.py", line 113, in main
        parser.parse_consts_typedefs(src)
      File "/tmp/pip-req-build-e4i_e72j/dm_control/autowrap/binding_generator.py", line 355, in parse_consts_typedefs
        self.recurse_into_conditionals(tokens)
      File "/tmp/pip-req-build-e4i_e72j/dm_control/autowrap/binding_generator.py", line 370, in recurse_into_conditionals
        self.typedefs_dict.update({token.name: token.typename})
      File "/tmp/pip-req-build-e4i_e72j/dm_control/autowrap/codegen_util.py", line 78, in __setitem__
        raise ValueError("Key '{}' already exists.".format(k))
    ValueError: Key 'mjtNum' already exists.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-e4i_e72j/setup.py", line 176, in <module>
        setup(
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-req-build-e4i_e72j/setup.py", line 140, in run
        self.run_command('build_mjbindings')
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-req-build-e4i_e72j/setup.py", line 115, in run
        subprocess.check_call(command)
      File "/home/kostrikov/miniconda3/envs/test/lib/python3.9/subprocess.py", line 373, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/home/kostrikov/miniconda3/envs/test/bin/python', 'dm_control/autowrap/autowrap.py', '--header_paths=/home/kostrikov/.mujoco/mujoco210/include/mjdata.h /home/kostrikov/.mujoco/mujoco210/include/mjmodel.h /home/kostrikov/.mujoco/mujoco210/include/mjrender.h /home/kostrikov/.mujoco/mujoco210/include/mjui.h /home/kostrikov/.mujoco/mujoco210/include/mjvisualize.h /home/kostrikov/.mujoco/mujoco210/include/mjxmacro.h /home/kostrikov/.mujoco/mujoco210/include/mujoco.h', '--output_dir=/tmp/pip-req-build-e4i_e72j/build/lib/dm_control/mujoco/wrapper/mjbindings']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/kostrikov/miniconda3/envs/test/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-e4i_e72j/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-e4i_e72j/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-celpm6j2/install-record.txt --single-version-externally-managed --compile --install-headers /home/kostrikov/miniconda3/envs/test/include/python3.9/dm-control Check the logs for full command output.
@Harimus
Copy link

Harimus commented Oct 25, 2021

Same Issue here, while trying to install d4rl. D4RL seems to still run on mujoco200, but seems to not have the dm_control dependency versioned and looks for the most recent one. adding mujoco210 removes one error but I endu p withi similar error to above.

@peteflorence
Copy link

Hey folks, does this fix the issue for you? This reverts dm_control back to when it was running on mujoco200: Farama-Foundation/D4RL#126

@saran-t saran-t added the bug label Oct 25, 2021
@saran-t saran-t self-assigned this Oct 25, 2021
@saran-t
Copy link
Member

saran-t commented Oct 25, 2021

I'll look into this. FWIW we run continuous integration against MuJoCo 2.1 on Ubuntu 16 and are not seeing this issue, so will need to investigate further.

@saran-t
Copy link
Member

saran-t commented Oct 25, 2021

Could you please try replacing https://github.com/deepmind/dm_control/blob/master/setup.py#L196 with 'pyparsing < 3.0.0'?

@ikostrikov
Copy link
Author

Using an older version of pyparsing seems to resolve the issue.

Thanks a lot!

@saran-t
Copy link
Member

saran-t commented Oct 25, 2021

I'll push a change to fix this shortly. It turns out that our CI didn't pick up this bug because we're running pip install -r requirements.txt before building dm_control.

For clarity: this issue is not related to the recent upgrade to MuJoCo 2.1. Just bad timing 🙂.

@saran-t
Copy link
Member

saran-t commented Oct 26, 2021

Just out of curiosity: why are people installing dm_control from source rather than through the PyPI wheel?

@ikostrikov
Copy link
Author

@saran-t it seems that most people had this issues because d4rl uses a git dependency instead of the PyPi wheel:
https://github.com/rail-berkeley/d4rl/blob/master/setup.py#L17

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

No branches or pull requests

4 participants