question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs

See original GitHub issue

📚 Installation

Environment

  • OS: Ubuntu 18.04
  • Python version: 3.6.9
  • PyTorch version: 1.4.0
  • CUDA/cuDNN version: 10.0
  • GCC version: 7.4
  • How did you try to install PyTorch Geometric and its extensions (pip, source): pip
  • Any other relevant information: I have been using this library for a long time. I am quite surprised by this sudden error, even after couple of reinstalls.

Checklist

  • I followed the installation guide.
  • I cannot find my error message in the FAQ.
  • I set up CUDA correctly and can compile CUDA code via nvcc.
  • I have cloned the repository and tried a manual installation from source.
  • I do have multiple CUDA versions on my machine.
  • I checked if the official extension example runs on my machine.
  • The offical extension example runs on my machine.

Additional context

Error log while importing:

>>> import torch
>>> import torch_scatter
Traceback (most recent call last):
  File "/home/pranav/.local/lib/python3.6/site-packages/torch_scatter/__init__.py", line 13, in <module>
    library, [osp.dirname(__file__)]).origin)
  File "/usr/lib/python3/dist-packages/torch/_ops.py", line 106, in load_library
    ctypes.CDLL(path)
  File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/pranav/.local/lib/python3.6/site-packages/torch_scatter/_version.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pranav/.local/lib/python3.6/site-packages/torch_scatter/__init__.py", line 21, in <module>
    raise OSError(e)
OSError: /home/pranav/.local/lib/python3.6/site-packages/torch_scatter/_version.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs
>>> import torch_sparse
Traceback (most recent call last):
  File "/home/pranav/.local/lib/python3.6/site-packages/torch_sparse/__init__.py", line 14, in <module>
    library, [osp.dirname(__file__)]).origin)
  File "/usr/lib/python3/dist-packages/torch/_ops.py", line 106, in load_library
    ctypes.CDLL(path)
  File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/pranav/.local/lib/python3.6/site-packages/torch_sparse/_version.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pranav/.local/lib/python3.6/site-packages/torch_sparse/__init__.py", line 22, in <module>
    raise OSError(e)
OSError: /home/pranav/.local/lib/python3.6/site-packages/torch_sparse/_version.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:24 (8 by maintainers)

github_iconTop GitHub Comments

33reactions
dongwei156commented, Mar 31, 2020

I have solved this problem. The reason is that: do not install pytorch via anaconda-navigator ! It will install both cpu and gpu versions, even though you only select the pytorch. You can download the specific version of the pytorch from:

https://download.pytorch.org/whl/torch_stable.html,

and this problem will be solved. All dependent packages are listed: cu101/torch-1.4.0-cp38-cp38-linux_x86_64.whl cu101/torchvision-0.5.0-cp38-cp38-linux_x86_64.whl torch_cluster-1.5.3+cu101-cp38-cp38-linux_x86_64.whl torch_scatter-2.0.4+cu101-cp38-cp38-linux_x86_64.whl torch_sparse-0.6.1+cu101-cp38-cp38-linux_x86_64.whl torch_spline_conv-1.2.0+cu101-cp38-cp38-linux_x86_64.whl

The author is right! Multi-versions of pytorch (CPU and GPU) result in this problem!

6reactions
rusty1scommented, Mar 2, 2020

This error is usually explained by using multiple PyTorch or multiple CUDA versions, and the extensions get compiled with the one that you are not using within PyTorch. BTW, you can now also try out our Python binaries for a smoother installation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

can't run with this error: undefined symbol ... - GitHub
Hi! I installed the PyG according to the documentation(https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html). tried to run ...
Read more >
how to solve the pytorch_geometric install error. Undefined ...
Undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs #999. solution: conda install pytorch pyg -c pytorch -c pyg -c conda-forge.
Read more >
OSError:torch_sparse/_version.so: undefined symbol ...
OSError:torch_sparse/_version.so : undefined symbol:_ZN5torch3jit17parseSchemaOrNameERKSs ; Ubuntu20.04 中已经安装Pytorch 但Import 报错- 解决记录.
Read more >
undefined reference to symbok '_ZN5 - 程序员宅基地
在经过一系列麻烦的安装过程之后,结果一运行就报错了——OSError:torch_sparse/_version.so: undefined symbol:_ZN5torch3jit17parseSchemaOrNameERKSs。
Read more >
简单粗暴2-安装torch_geometric库-Linux-全过程 - 知乎专栏
OSError:torch_sparse/_version.so: undefined symbol:_ZN5torch3jit17parseSchemaOrNameERKSs. 原因是conda帮我们自动安装的pytorch包含cpu/gpu 两 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found