Skip to content

[BUG] Unable to install torchrl via pipΒ #2035

Closed
@laurenzlevi

Description

Describe the bug

Unable to install torchrl via pip for python312.

>>> pip install torchrl
ERROR: Could not find a version that satisfies the requirement torchrl (from versions: none)
ERROR: No matching distribution found for torchrl

To Reproduce

Fresh install of python 3.12, running pip install torchrl triggers the error mentioned above.

Installing via pip install git+https://github.com/pytorch/rl.git gives the error message

ERROR: Could not find a version that satisfies the requirement tensordict>=0.4.0 (from torchrl) (from versions: 0.0.1a0, 0.0.1b0, 0.0.1rc0, 0.0.2a0, 0.0.2b0, 0.0.3, 0.1.0, 0.1.1, 0.1.2)
ERROR: No matching distribution found for tensordict>=0.4.0

Installing tensordict via pip install git+https://github.com/pytorch-labs/tensordict works and allows for a subsequent installation of torchrl via pip install git+https://github.com/pytorch/rl.git, but using the module leads to the following error

Traceback (most recent call last):
  File "C:\Projects\repos\Rainbow-DQN\test.py", line 1, in <module>
    from torchrl.modules.models import NoisyLazyLinear
  File "C:\Users\pixel\AppData\Local\Programs\Python\Python312\Lib\site-packages\torchrl\__init__.py", line 10, in <module>
    from tensordict import set_lazy_legacy
  File "C:\Users\pixel\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensordict\__init__.py", line 6, in <module>
    from tensordict._lazy import LazyStackedTensorDict
  File "C:\Users\pixel\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensordict\_lazy.py", line 24, in <module>
    from functorch import dim as ftdim
  File "C:\Users\pixel\AppData\Local\Programs\Python\Python312\Lib\site-packages\functorch\dim\__init__.py", line 7, in <module>
    import functorch._C
ImportError: initialization failed

Expected behavior

torchrl should install.

System info

Describe the characteristic of your environment:

  • Library was installed via pip and ``git+https`
  • Python 3.12
  • Tensordict 0.4.0+b4c91e8 (installed via pip install git+https://github.com/pytorch-labs/tensordict, because pip install tensordict installs version tensordict-0.1.2 but torchrl requires tensordict>=0.4.0)
  • torch 2.2.1+cu121 (works flawlessly)

System information:

  • sys.__version: 3.12.2 (tags/v3.12.2:6abddd9, Feb 6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)]
  • Platform: Windows 10 Home 10.0.19045 Build 19045
  • Cuda: release 12.3, V12.3.103

Checklist

  • [ x] I have checked that there is no similar issue in the repo (required)
  • [ x] I have read the documentation (required)
  • [ x] I have provided a minimal working example to reproduce the bug (required)

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions