Pytorch Geometric CPU only version ImportError:

Hi experts,
I got an import error while importing pytorch_geometric.

My environment:
//======================================
CentOS Linux release 7.6.1810 (Core)
Python 3.6.8 :: Anaconda custom (64-bit)
torch==1.2.0+cpu
torch-cluster==1.4.4
torch-geometric==1.3.1
torch-scatter==1.3.1
torch-sparse==0.4.0
torch-spline-conv==1.1.0
torchvision==0.4.0+cpu
//======================================

Error messages:
//======================================

import torch
import torch_geometric
Traceback (most recent call last):
File “”, line 1, in
File “/home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch_geometric/init.py”, line 2, in
import torch_geometric.nn
File “/home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch_geometric/nn/init.py”, line 2, in
from .data_parallel import DataParallel
File “/home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch_geometric/nn/data_parallel.py”, line 5, in
from torch_geometric.data import Batch
File “/home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch_geometric/data/init.py”, line 1, in
from .data import Data
File “/home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch_geometric/data/data.py”, line 7, in
from torch_sparse import coalesce
File “/home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch_sparse-0.4.0-py3.6-linux-x86_64.egg/torch_sparse/init.py”, line 6, in
from .spspmm import spspmm
File “/home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch_sparse-0.4.0-py3.6-linux-x86_64.egg/torch_sparse/spspmm.py”, line 4, in
import torch_sparse.spspmm_cpu
ImportError: /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch_sparse-0.4.0-py3.6-linux-x86_64.egg/torch_sparse/spspmm_cpu.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
// ===========================================

Did you get any errors/warning during the installation of pytorch_geometric?

PS: I think you might get a better answer, if you create an issue in the repo.

1 Like

Hi ptrblck,
Thanks for the reply and advice I will post it in the repo, there is no warning and/or error installing pytorch_geometric

//==========================================================

pip install torch-geometric
Collecting torch-geometric
Requirement already satisfied: plyfile in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (0.7)
Requirement already satisfied: scipy in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (1.3.1)
Requirement already satisfied: pandas in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (0.24.2)
Requirement already satisfied: scikit-learn in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (0.21.3)
Requirement already satisfied: h5py in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (2.9.0)
Requirement already satisfied: networkx in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (2.2)
Requirement already satisfied: numpy in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (1.16.4)
Requirement already satisfied: googledrivedownloader in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (0.4)
Requirement already satisfied: rdflib in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from torch-geometric) (4.2.2)
Requirement already satisfied: pytz>=2011k in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from pandas->torch-geometric) (2018.9)
Requirement already satisfied: python-dateutil>=2.5.0 in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from pandas->torch-geometric) (2.8.0)
Requirement already satisfied: joblib>=0.11 in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from scikit-learn->torch-geometric) (0.13.2)
Requirement already satisfied: six in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from h5py->torch-geometric) (1.12.0)
Requirement already satisfied: decorator>=4.3.0 in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from networkx->torch-geometric) (4.4.0)
Requirement already satisfied: pyparsing in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from rdflib->torch-geometric) (2.3.1)
Requirement already satisfied: isodate in /home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages (from rdflib->torch-geometric) (0.6.0)
Installing collected packages: torch-geometric
Successfully installed torch-geometric-1.3.1