takuseno / d3rlpy

An offline deep reinforcement learning library
https://takuseno.github.io/d3rlpy
MIT License
1.29k stars 230 forks source link

a question about d3rlpy 1.1.1 install bug #408

Closed lijianfromearth closed 1 month ago

lijianfromearth commented 1 month ago

I'm trying to run an open-source code, but it uses d3rlpy version 1.1.1. the pip install method have a bug:

pip install d3rlpy==1.1.1 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting d3rlpy==1.1.1 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/3b/0c/bba8b546426819a2c297ddd9f2268b5f156180057e8db4a6b66eafa78e9b/d3rlpy-1.1.1.tar.gz (317 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [47 lines of output] /home/yaxun/.conda/envs/rl-icub-dexterous/lib/python3.12/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-install-y0qr7okz/d3rlpy_80e87466463e4bcd9efd799c8185c313/d3rlpy/dataset.pxd tree = Parsing.p_module(s, pxd, full_module_name)

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

  from cython cimport view

  from cython.parallel import prange

  from dataset cimport CTransition
  ^
  ------------------------------------------------------------

  d3rlpy/dataset.pyx:15:0: 'dataset.pxd' not found

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

  from cython cimport view

  from cython.parallel import prange

  from dataset cimport CTransition
  ^
  ------------------------------------------------------------

  d3rlpy/dataset.pyx:15:0: 'dataset/CTransition.pxd' not found
  performance hint: d3rlpy/dataset.pyx:1053:5: Exception check on '_stack_frames' will always require the GIL to be acquired.
  Possible solutions:
      1. Declare '_stack_frames' 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 '_stack_frames' to allow an error code to be returned.
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-y0qr7okz/d3rlpy_80e87466463e4bcd9efd799c8185c313/setup.py", line 23, in <module>
      ext_modules = cythonize([ext],
                    ^^^^^^^^^^^^^^^^
    File "/home/yaxun/.conda/envs/rl-icub-dexterous/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "/home/yaxun/.conda/envs/rl-icub-dexterous/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: d3rlpy/dataset.pyx
  Compiling d3rlpy/dataset.pyx because it changed.
  [1/1] Cythonizing d3rlpy/dataset.pyx
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

Also, I am trying to use the version 1.1.1 source code, but I encountered this error:

File "/home/yaxun/rl-icub-dexterous-manipulation/d3rlpy-1.1.1/d3rlpy/torch_utility.py", line 12, in from .dataset import TransitionMiniBatch ModuleNotFoundError: No module named 'd3rlpy.dataset'

Please guide me on how to use version 1.1.1. thank you ^v^.

lijianfromearth commented 1 month ago

sorry , I found it work on python 3.7.5 .

takuseno commented 1 month ago

Looks like you already resolved this issue? Feel free to reopen this if there is any further discussion.