Torch geometric radious graph

Hello, it is my first post here and i hope i’m in the right place to ask. When i try to run the example code for the torch_geometric.nn radious_graph i get an error:

File "C:\Users\nico_\AppData\Local\Programs\Python\Python38\lib\site-packages\torch_geometric\nn\pool\", line 210, in radius_graph
    return torch_cluster.radius_graph(x, r, batch, loop, max_num_neighbors,
AttributeError: 'NoneType' object has no attribute 'radius_graph'

the code is

import torch
from torch_geometric.nn import radius_graph

x = torch.Tensor([[-1, -1], [-1, 1], [1, -1], [1, 1]])
batch = torch.tensor([0, 0, 0, 0])
edge_index = radius_graph(x, r=1.5, batch=batch, loop=False)

The error is raised by torch_cluster.radius_graph as torch_cluster is apparently set to None.
At the top of the script you can see that import torch_cluster is used in a try ... except block here and will be set to None if the import fails.
Since all methods in this file seems to depend on torch_cluster I would expect to see an ImportError instead as the error message is quite misleading.
CC @rusty1s

I tried setting a venv in pycharm just for this project and now the problem has shifted to installing torch_cluster (same problem both for torch 1.13 and 2.0): after installing torch_geometric 2.3.0 i type the command

pip install torch_scatter torch_sparse torch_cluster torch_spline_conv -f

(with the last part torch-xxx+cpu.html 1.13 or 2.0 when trying with torch 1.13 or 2.0, both didn’t work) it gives me this error:

Looking in links:
ERROR: Could not find a version that satisfies the requirement pyg_lib (from versions: none)
ERROR: No matching distribution found for pyg_lib

thank you so far for the help

I just executed pip install torch_cluster and it built this library from source on my system.
I’m not familiar with the binary/release process of PyG, so don’t know which wheels exactly are available.

reinstalling everything i solved, thank you for your time, it was indeed a dependencies issue with torch cluster. Hoping this could turn useful to someone the versions are

torch -> 2.0.0+cpu
torch_gemetric -> 2.3.0
torch_cluster -> 1.6.1+pt20cpu
python -> 3.8