acxz / pkgbuilds

PKGBUILDs for Arch Linux
25 stars 44 forks source link

[python-torch-geometric 2.1.0-1] ModuleNotFoundError: No module named 'torch_sparse' #219

Closed nihil39 closed 1 year ago

nihil39 commented 1 year ago

Hi,

I successufully installed this package but when I simply try to import it in an empty python file, I get the following error.

File "/usr/lib/python3.10/site-packages/torch_geometric/data/data.py", line 20, in <module>
    from torch_sparse import SparseTensor
ModuleNotFoundError: No module named 'torch_sparse'

Should torch_sparse be a dependency of pytorch geometric?

Thank you.

acxz commented 1 year ago

Can you provide the import line that you are using to reproduce the error?

nihil39 commented 1 year ago

Just this simple snippet

import torch
import torch.nn as nn
import torch_geometric

Note that using only PyTorch (the first two lines) it works with no problem and I have the same error even with version 2.2.0-1

Or this one

import torch
from torch_geometric.data import Data

taken from here

nihil39 commented 1 year ago

The bug is reproducible, look at this forum post.

I think we have to update Pytorch Geometric PKGBUILD to require torch_sparse as a dependency and update the torch sparse package which is clearly outdated and unmaintained.

acxz commented 1 year ago

Yep, I can reproduce the bug as well. Looks like for the installation dependencies we also need to look at the following: https://github.com/pyg-team/pytorch_geometric#pytorch-113

acxz commented 1 year ago

I went ahead and added the deps to the package. You may need to open another issue of python-torch-sparse not building successfully though.