Giter Site home page Giter Site logo

Comments (10)

NishanthARao avatar NishanthARao commented on August 23, 2024 3

Here's what worked for me (Ubuntu 22.04):

  1. Downgraded Python 3.12 to Python 3.8 by using conda install python=3.8
  2. Install specific versions of setuptools and wheel: pip3 install setuptools==65.5.0 "wheel<0.40.0"
  3. Install cython<3 using pip3 install "cython<3"
  4. Replace mujoco-py==2.0.2.13 with mujoco-py==2.0.2.5

My environment.yml file looks like this:

name: diffuser
channels:
- defaults
- conda-forge
dependencies:
- python=3.8
- pip
- patchelf
- pip:
    - -f https://download.pytorch.org/whl/torch_stable.html
    - setuptools==65.5.0
    - wheel<0.40.0
    - mujoco-py==2.0.2.5
    - numpy
    - gym==0.18.0
    - matplotlib==3.3.4
    - torch==1.9.1+cu111
    - typed-argument-parser
    - git+https://github.com/Farama-Foundation/d4rl@f2a05c0d66722499bf8031b094d9af3aea7c372b#egg=d4rl
    - scikit-image==0.17.2
    - scikit-video==1.1.11
    - gitpython
    - einops
    - ffmpeg
    - ffprobe
    - pillow
    - tqdm
    - pandas
    - wandb
    - flax >= 0.3.5
    - jax <= 0.2.21
    - ray==2.0.0
    - crcmod # for fast gsutil rsync on large files
    - google-api-python-client
    - cryptography
    - git+https://github.com/JannerM/doodad.git@janner
    - gdown>=4.6.0

Other minor fixes I had to make:

  1. Convert np.int to np.int64 in file buffer.py
  2. Fix errors pertaining to LibGLEW.so and LibGL.so - This link helped a lot!

https://github.com/yuqingd/sim2real2sim_rad/blob/master/README.md#debugging-common-installation-errors

from diffuser.

staycoolish avatar staycoolish commented on August 23, 2024 1

After @NishanthARao 's version, which I couldn't build on Ubuntu 20.04, I tried using mujoco-py 2.0.2.5, and it worked. Here is the environment file:

name: diffuser
channels:
- defaults
- conda-forge
dependencies:
- python=3.8
- setuptools == 63.2.0
- wheel == 0.38.4
- pip == 22.2.2
- patchelf == 0.15.0.0
- Cmake
- cython == 0.29.36
- pip:
    - -f https://download.pytorch.org/whl/torch_stable.html
    - numpy
    - gym==0.18.0
    - mujoco-py==2.0.2.5
    - matplotlib==3.3.4
    - torch==1.9.1+cu111
    - typed-argument-parser
    - git+https://github.com/Farama-Foundation/d4rl@f2a05c0d66722499bf8031b094d9af3aea7c372b#egg=d4rl
    - scikit-image==0.17.2
    - scikit-video==1.1.11
    - gitpython
    - einops
    - ffmpeg
    - ffprobe
    - pillow==7.2.0
    - tqdm
    - pandas
    - wandb
    - flax >= 0.3.5
    - jax <= 0.2.21
    - ray==2.0.0
    - crcmod # for fast gsutil rsync on large files
    - google-api-python-client
    - cryptography
    - git+https://github.com/JannerM/doodad.git@janner
    - gdown>=4.6.0

I only had to change np.int to np.int64 in file buffer.py (diffuser/datasets/).

from diffuser.

jannerm avatar jannerm commented on August 23, 2024

What version of pip do you have?

from diffuser.

AasherH avatar AasherH commented on August 23, 2024

I am using pip 23.0.1. and Ubuntu 22.04. I also will note that when manually installing the dependencies in the .yml file, the main issues were compatibility between mujoco and gym. For example, commenting out the gym=0.18.0 installation in the .yml file, I get the following errors:

Pip subprocess error:
Running command git clone --filter=blob:none --quiet https://github.com/JannerM/doodad.git /tmp/pip-req-build-z1m78mwk
Running command git checkout -b janner --track origin/janner
Switched to a new branch 'janner'
Branch 'janner' set up to track remote branch 'janner' from 'origin'.
Running command git clone --filter=blob:none --quiet https://github.com/aravindr93/mjrl /tmp/pip-install-xnyhflty/mjrl_e6e2358e931041e19fd0e94ac3e67343
error: subprocess-exited-with-error

× Building wheel for mujoco-py (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [95 lines of output]
running bdist_wheel
running build
performance hint: mujoco_py/cymj.pyx:67:5: Exception check on 'c_warning_callback' will always require the GIL to be acquired.
Possible solutions:
1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on the function to allow an error code to be returned.
performance hint: mujoco_py/cymj.pyx:104:5: Exception check on 'c_error_callback' will always require the GIL to be acquired.
Possible solutions:
1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on the function to allow an error code to be returned.

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      See c_warning_callback, which is the C wrapper to the user defined function
      '''
      global py_warning_callback
      global mju_user_warning
      py_warning_callback = warn
      mju_user_warning = c_warning_callback
                         ^
  ------------------------------------------------------------
  
  mujoco_py/cymj.pyx:92:23: Cannot assign type 'void (const char *) except * nogil' to 'void (*)(const char *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (const char *) except * nogil'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      See c_warning_callback, which is the C wrapper to the user defined function
      '''
      global py_error_callback
      global mju_user_error
      py_error_callback = err_callback
      mju_user_error = c_error_callback
                       ^
  ------------------------------------------------------------
  
  mujoco_py/cymj.pyx:127:21: Cannot assign type 'void (const char *) except * nogil' to 'void (*)(const char *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (const char *) except * nogil'.
  Removing old mujoco_py cext /tmp/pip-install-xnyhflty/mujoco-py_ad196a9625654fe7992f3cbc753dd639/mujoco_py/generated/cymj_2.0.2.13_38_linuxcpuextensionbuilder_38.so

from diffuser.

kensukenk avatar kensukenk commented on August 23, 2024

I have the same issues on ubuntu 20.04

from diffuser.

kensukenk avatar kensukenk commented on August 23, 2024

I was able to resolve the issue with gym from https://stackoverflow.com/questions/76129688/why-is-pip-install-gym-failing-with-python-setup-py-egg-info-did-not-run-succ

I also ran into the second issue with mujoco-py but this issue went away after installing mujoco-py==2.0.2.5.

from diffuser.

yibo2222 avatar yibo2222 commented on August 23, 2024

I was able to resolve the issue with gym from https://stackoverflow.com/questions/76129688/why-is-pip-install-gym-failing-with-python-setup-py-egg-info-did-not-run-succ

I also ran into the second issue with mujoco-py but this issue went away after installing mujoco-py==2.0.2.5.

Can I see your environment.yml file? I tried your fix for the second issue, but my pip installation fails when I try create the environment

from diffuser.

Lycanthropy-Tori avatar Lycanthropy-Tori commented on August 23, 2024

I am using pip 23.0.1. and Ubuntu 22.04. I also will note that when manually installing the dependencies in the .yml file, the main issues were compatibility between mujoco and gym. For example, commenting out the gym=0.18.0 installation in the .yml file, I get the following errors:

Pip subprocess error: Running command git clone --filter=blob:none --quiet https://github.com/JannerM/doodad.git /tmp/pip-req-build-z1m78mwk Running command git checkout -b janner --track origin/janner Switched to a new branch 'janner' Branch 'janner' set up to track remote branch 'janner' from 'origin'. Running command git clone --filter=blob:none --quiet https://github.com/aravindr93/mjrl /tmp/pip-install-xnyhflty/mjrl_e6e2358e931041e19fd0e94ac3e67343 error: subprocess-exited-with-error

× Building wheel for mujoco-py (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [95 lines of output] running bdist_wheel running build performance hint: mujoco_py/cymj.pyx:67:5: Exception check on 'c_warning_callback' will always require the GIL to be acquired. Possible solutions: 1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions. 2. Use an 'int' return type on the function to allow an error code to be returned. performance hint: mujoco_py/cymj.pyx:104:5: Exception check on 'c_error_callback' will always require the GIL to be acquired. Possible solutions: 1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions. 2. Use an 'int' return type on the function to allow an error code to be returned.

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      See c_warning_callback, which is the C wrapper to the user defined function
      '''
      global py_warning_callback
      global mju_user_warning
      py_warning_callback = warn
      mju_user_warning = c_warning_callback
                         ^
  ------------------------------------------------------------
  
  mujoco_py/cymj.pyx:92:23: Cannot assign type 'void (const char *) except * nogil' to 'void (*)(const char *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (const char *) except * nogil'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      See c_warning_callback, which is the C wrapper to the user defined function
      '''
      global py_error_callback
      global mju_user_error
      py_error_callback = err_callback
      mju_user_error = c_error_callback
                       ^
  ------------------------------------------------------------
  
  mujoco_py/cymj.pyx:127:21: Cannot assign type 'void (const char *) except * nogil' to 'void (*)(const char *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (const char *) except * nogil'.
  Removing old mujoco_py cext /tmp/pip-install-xnyhflty/mujoco-py_ad196a9625654fe7992f3cbc753dd639/mujoco_py/generated/cymj_2.0.2.13_38_linuxcpuextensionbuilder_38.so

I have met same problem. Have you solved it right now?

from diffuser.

staycoolish avatar staycoolish commented on August 23, 2024

If you install mujoco-py-2.0.2.8, the environment will be created, but then you won't be able to use it due to compatibility issues. I tried to use the planning prompt - before which I downloaded the weights following the tutorial page - and it didn't work. Here is the latest environment file I have:

name: diffuser
channels:
- defaults
- conda-forge
dependencies:
- python=3.8
- setuptools == 63.2.0
- wheel == 0.38.4
- pip == 22.2.2
- patchelf 
- Cmake
- pip:
    - -f https://download.pytorch.org/whl/torch_stable.html
    - numpy
    - gym==0.18.0
    - mujoco-py==2.0.2.13
    - matplotlib==3.3.4
    - torch==1.9.1+cu111
    - typed-argument-parser
    - git+https://github.com/Farama-Foundation/d4rl@f2a05c0d66722499bf8031b094d9af3aea7c372b#egg=d4rl
    - scikit-image==0.17.2
    - scikit-video==1.1.11
    - gitpython
    - einops
    - ffmpeg
    - ffprobe
    - pillow==7.2.0
    - tqdm
    - pandas
    - wandb
    - flax >= 0.3.5
    - jax <= 0.2.21
    - ray==2.0.0
    - crcmod # for fast gsutil rsync on large files
    - google-api-python-client
    - cryptography
    - git+https://github.com/JannerM/doodad.git@janner
    - gdown>=4.6.0

It gives the wheel for mujoco-py error in Ubuntu 20.4.6. I opened another issue and shared a working environment.yml file there ( #58 ), the one from Diffusion Policy paper, but they seem to use free-mujoco-py, among with different packages.

from diffuser.

richie-live avatar richie-live commented on August 23, 2024
  • pip=24.0 # to install gym==0.18.0

from diffuser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.