pytorch_cluster icon indicating copy to clipboard operation
pytorch_cluster copied to clipboard

pip install not working with torch==2.3.0

Open hsharsh opened this issue 1 year ago • 3 comments
trafficstars

I am trying to create a torch repo which has a C++ backend and I wanted to use pytorch_cluster as a reference for it. I have installed pytorch_cluster with pip from the cloned repo

pip install torch==2.3.0
pip install .

But when I try to import pytorch_cluster, it seems like there are some discrepancies with the installation?

Python 3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch_cluster
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/hsharsh/envs/torch_cluster/lib/python3.11/site-packages/torch_cluster/__init__.py", line 18, in <module>
    torch.ops.load_library(spec.origin)
  File "/Users/hsharsh/envs/torch_cluster/lib/python3.11/site-packages/torch/_ops.py", line 1032, in load_library
    ctypes.CDLL(path)
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(/Users/hsharsh/envs/torch_cluster/lib/python3.11/site-packages/torch_cluster/_version_cpu.so, 0x0006): Symbol not found: __ZN5torch3jit17parseSchemaOrNameERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb
  Referenced from: <615DC186-B48E-343A-9ED1-B43018EB4628> /Users/hsharsh/envs/torch_cluster/lib/python3.11/site-packages/torch_cluster/_version_cpu.so
  Expected in:     <2A8DB508-8AAF-3FF1-BDFE-9EF17CC2B482> /Users/hsharsh/envs/torch_cluster/lib/python3.11/site-packages/torch/lib/libtorch_cpu.dylib

When I try the same thing with torch==2.4.0, it seems to work fine. The problem here is that I am also going to use torch_geometric as dependency in my library but the wheels for torch==2.4.0 don't exist for torch_geometric, as that version is not supported yet.

Environment details: Python: 3.11.9 OS: Darwin Kernel Version 23.5.0 pip: 24.0

hsharsh avatar Jul 29 '24 21:07 hsharsh