rail-berkeley/softlearning

Conda installation problem Ubuntu 18.04

Jendker opened this issue · 3 comments

Similarly as here:

avisingh599/reward-learning-rl#19

I get the following error when installing with Conda under Ubuntu 18.04:

Pip subprocess error:
  Running command git clone -q https://github.com/deepmind/dm_control.git /tmp/pip-req-build-flq5t_5w
  Running command git checkout -q e681949dda5ef1b05acf4fad99a134101469d8e7
  Running command git clone -q https://github.com/hartikainen/gym.git /tmp/pip-req-build-b30xj6bu
  Running command git checkout -q ddef8a1418724354e93f82a5109ee9b7006521a5
  Running command git clone -q https://github.com/hartikainen/mujoco-py.git /tmp/pip-req-build-n3ikxkdp
  Running command git checkout -q 435d2143abe04fe4648c6c0c1b848bf1fc06b73b
  fatal: reference is not a tree: 435d2143abe04fe4648c6c0c1b848bf1fc06b73b
ERROR: Command errored out with exit status 128: git checkout -q 435d2143abe04fe4648c6c0c1b848bf1fc06b73b Check the logs for full command output.

If I replace in requirements.txt

git+https://github.com/hartikainen/mujoco-py.git@435d2143abe04fe4648c6c0c1b848bf1fc06b73b

with

git+https://github.com/hartikainen/mujoco-py.git

I am able to install the conda environment, but then when running example from README I get the following error:

softlearning run_example_local examples.development \
    --universe=gym \
    --domain=HalfCheetah \
    --task=v3 \
    --exp-name=my-sac-experiment-1 \
    --checkpoint-frequency=1000
/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.1) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
Traceback (most recent call last):
  File "/home/jedrzej/anaconda3/envs/softlearning/bin/softlearning", line 11, in <module>
    load_entry_point('softlearning', 'console_scripts', 'softlearning')()
  File "/home/jedrzej/GitHub/softlearning/softlearning/scripts/console_scripts.py", line 202, in main
    return cli()
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jedrzej/GitHub/softlearning/softlearning/scripts/console_scripts.py", line 71, in run_example_local_cmd
    return run_example_local(example_module_name, example_argv)
  File "/home/jedrzej/GitHub/softlearning/examples/instrument.py", line 204, in run_example_local
    example_args = example_module.get_parser().parse_args(example_argv)
  File "/home/jedrzej/GitHub/softlearning/examples/development/__init__.py", line 21, in get_parser
    from examples.utils import get_parser
  File "/home/jedrzej/GitHub/softlearning/examples/utils.py", line 9, in <module>
    import softlearning.environments.utils as env_utils
  File "/home/jedrzej/GitHub/softlearning/softlearning/environments/utils.py", line 1, in <module>
    from .adapters.gym_adapter import GymAdapter
  File "/home/jedrzej/GitHub/softlearning/softlearning/environments/adapters/gym_adapter.py", line 8, in <module>
    from gym.envs.mujoco.mujoco_env import MujocoEnv
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/gym/envs/mujoco/__init__.py", line 1, in <module>
    from gym.envs.mujoco.mujoco_env import MujocoEnv
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/gym/envs/mujoco/mujoco_env.py", line 12, in <module>
    import mujoco_py
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/mujoco_py/__init__.py", line 3, in <module>
    from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/mujoco_py/builder.py", line 506, in <module>
    cymj = load_cython_ext(mujoco_path)
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/mujoco_py/builder.py", line 101, in load_cython_ext
    mod = load_dynamic_ext('cymj', cext_so_path)
  File "/home/jedrzej/anaconda3/envs/softlearning/lib/python3.7/site-packages/mujoco_py/builder.py", line 125, in load_dynamic_ext
    return loader.load_module()
  File "__init__.pxd", line 918, in init mujoco_py.cymj
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

I met exactly the same error as above, and I also dont know how to deal with this problem. @hartikainen

Can you try installing mujoco from pip, i.e. pip install -U mujoco-py? I also updated a bunch of dependencies in the PR that just got merged (#110). Hopefully those changes make things work out of the box. If not, feel free to open another issue and I'll take a look at it.

I tried several combinations of different gym and mujoco-py, none of them worked and thus I returned to a former version of softlearning codes. Thanks for your advices.