pytorch_cluster icon indicating copy to clipboard operation
pytorch_cluster copied to clipboard

Installing torch-cluster

Open kristianeschenburg opened this issue 3 years ago • 1 comments
trafficstars

Hello

I'm trying to install torch-cluster for use with torch-geometric within a Python3.8 conda environment on an Apple M1 machine. Within the environment, I'm installing torch-cluster as:

python3 -m pip install torch-cluster

The install runs successfully. However, when trying to import torch_cluster within this conda environment, I receive the following error:

Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:05:47)
[Clang 12.0.1 ] 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/krieschenburg/miniforge_x86_64/envs/DND/lib/python3.8/site-packages/torch_cluster/__init__.py", line 18, in <module>
    torch.ops.load_library(spec.origin)
  File "/Users/krieschenburg/miniforge_x86_64/envs/DND/lib/python3.8/site-packages/torch/_ops.py", line 255, in load_library
    ctypes.CDLL(path)
  File "/Users/krieschenburg/miniforge_x86_64/envs/DND/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/krieschenburg/miniforge_x86_64/envs/DND/lib/python3.8/site-packages/torch_cluster/_fps_cpu.so, 0x0006): Symbol not found: __ZN2at8internal15invoke_parallelExxxRKNSt3__18functionIFvxxEEE
  Referenced from: /Users/krieschenburg/miniforge_x86_64/envs/DND/lib/python3.8/site-packages/torch_cluster/_fps_cpu.so
  Expected in: /Users/krieschenburg/miniforge_x86_64/envs/DND/lib/python3.8/site-packages/torch/lib/libtorch_cpu.dylib

I'm not sure why this error is arising. However, I have found an installation workaround via

python3 -m pip install torch-cluster --no-cache-dir

When importing torch-cluster after this install, this import works fine. Presumably, something during the wheel build time is producing this error?

kristianeschenburg avatar Aug 21 '22 22:08 kristianeschenburg

It looks like a broken installation has been cached by pip - not sure if there is there is anything to fix on our end. Let me know :)

rusty1s avatar Aug 22 '22 14:08 rusty1s

This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?

github-actions[bot] avatar Feb 19 '23 01:02 github-actions[bot]