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.

Error installing OSError undefined symbols

See original GitHub issue

Background

I am facing installation issues. Note, my installation is in a fresh conda environment, and my only manual installs were numpy and pytorch before running

conda install -c milagraph -c conda-forge torchdrug

Details below, and happy to provide more info. Thanks!

System and Conda Env Info

System information Ubuntu 20.04.2 LTS, 64-bit No GPU

python --version
> Python 3.8.8
conda --version
> conda 4.10.3
conda --list
># Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             4.5                       1_gnu  
alsa-lib                  1.2.3                h516909a_0    conda-forge
boost                     1.74.0           py38hc10631b_3    conda-forge
boost-cpp                 1.74.0               h312852a_4    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cairo                     1.16.0            h6cf1ce9_1008    conda-forge
certifi                   2021.5.30        py38h578d9bd_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cpuonly                   1.0                           0    pytorch
cycler                    0.10.0                     py_2    conda-forge
dbus                      1.13.6               h48d8840_2    conda-forge
decorator                 5.0.9              pyhd8ed1ab_0    conda-forge
expat                     2.4.1                h9c3ff4c_0    conda-forge
fontconfig                2.13.1            hba837de_1005    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
gettext                   0.19.8.1          h0b5b191_1005    conda-forge
glib                      2.68.3               h9c3ff4c_0    conda-forge
glib-tools                2.68.3               h9c3ff4c_0    conda-forge
greenlet                  1.1.0            py38h709712a_0    conda-forge
gst-plugins-base          1.18.4               hf529b03_2    conda-forge
gstreamer                 1.18.4               h76c114f_2    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
intel-openmp              2021.3.0          h06a4308_3350  
jbig                      2.1               h7f98852_2003    conda-forge
jinja2                    3.0.1              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
kiwisolver                1.3.1            py38h1fd1430_1    conda-forge
krb5                      1.19.2               hcc1bbae_0    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.35.1               h7274673_9  
lerc                      2.2.1                h9c3ff4c_0    conda-forge
libblas                   3.9.0           11_linux64_openblas    conda-forge
libcblas                  3.9.0           11_linux64_openblas    conda-forge
libclang                  11.1.0          default_ha53f305_1    conda-forge
libdeflate                1.7                  h7f98852_5    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.3.0               h5101ec6_17  
libgfortran-ng            11.1.0               h69a702a_8    conda-forge
libgfortran5              11.1.0               h6c583b3_8    conda-forge
libglib                   2.68.3               h3e27bee_0    conda-forge
libgomp                   9.3.0               h5101ec6_17  
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0           11_linux64_openblas    conda-forge
libllvm11                 11.1.0               hf817b99_2    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.17          pthreads_h8fe5266_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libpq                     13.3                 hd57d9b9_0    conda-forge
libstdcxx-ng              9.3.0               hd4cf53a_17  
libtiff                   4.3.0                hf544144_1    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.2.0                h7f98852_2    conda-forge
libxcb                    1.13              h7f98852_1003    conda-forge
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
markupsafe                2.0.1            py38h497a2fe_0    conda-forge
matplotlib                3.4.2            py38h578d9bd_0    conda-forge
matplotlib-base           3.4.2            py38hcc49a3a_0    conda-forge
mkl                       2021.3.0           h06a4308_520  
mysql-common              8.0.25               ha770c72_2    conda-forge
mysql-libs                8.0.25               hfa10184_2    conda-forge
ncurses                   6.2                  he6710b0_1  
networkx                  2.5                        py_0    conda-forge
ninja                     1.10.2               h4bd325d_0    conda-forge
nspr                      4.30                 h9c3ff4c_0    conda-forge
nss                       3.67                 hb5efdd6_0    conda-forge
numpy                     1.21.1           py38h9894fe3_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1k               h7f98852_0    conda-forge
pandas                    1.3.1            py38h1abd341_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pillow                    8.3.1            py38h8e6f84c_0    conda-forge
pip                       21.2.3             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pycairo                   1.20.1           py38hf61ee4a_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt                      5.12.3           py38h578d9bd_7    conda-forge
pyqt-impl                 5.12.3           py38h7400c14_7    conda-forge
pyqt5-sip                 4.19.18          py38h709712a_7    conda-forge
pyqtchart                 5.12             py38h7400c14_7    conda-forge
pyqtwebengine             5.12.1           py38h7400c14_7    conda-forge
python                    3.8.11          h12debd9_0_cpython  
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.8                      2_cp38    conda-forge
pytorch                   1.4.0               py3.8_cpu_0  [cpuonly]  pytorch
pytorch_scatter           2.0.4            py38h9235441_1    conda-forge
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
qt                        5.12.9               hda022c4_4    conda-forge
rdkit                     2021.03.4        py38hf8acc3d_0    conda-forge
readline                  8.1                  h27cfd23_0  
reportlab                 3.5.68           py38hadf75a6_0    conda-forge
setuptools                52.0.0           py38h06a4308_0  
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlalchemy                1.4.22           py38h497a2fe_0    conda-forge
sqlite                    3.36.0               hc218d9a_0  
tk                        8.6.10               hbc83047_0  
torchaudio                0.4.0                      py38    pytorch
torchdrug                 0.1.0                  h39ad8c7    milagraph
torchvision               0.5.0                  py38_cpu  [cpuonly]  pytorch
tornado                   6.1              py38h497a2fe_1    conda-forge
tqdm                      4.62.0             pyhd8ed1ab_0    conda-forge
wheel                     0.36.2             pyhd3eb1b0_0  
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.5.0                ha95c52a_0    conda-forge

Error output

Here is the error:

(torchdrug) 1_Projects $ python
Python 3.8.11 (default, Aug  3 2021, 15:09:35) 
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torchdrug
Traceback (most recent call last):
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torch_scatter/__init__.py", line 12, in <module>
    torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torch/_ops.py", line 106, in load_library
    ctypes.CDLL(path)
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torch_scatter/_version.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torchdrug/__init__.py", line 1, in <module>
    from . import patch
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torchdrug/patch.py", line 12, in <module>
    from torchdrug import core, data
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torchdrug/core/__init__.py", line 2, in <module>
    from .engine import Engine
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torchdrug/core/engine.py", line 10, in <module>
    from torchdrug import data, core, utils
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torchdrug/data/__init__.py", line 1, in <module>
    from .graph import Graph, PackedGraph, cat
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torchdrug/data/graph.py", line 9, in <module>
    from torch_scatter import scatter_add, scatter_min
  File "/home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torch_scatter/__init__.py", line 21, in <module>
    raise OSError(e)
OSError: /home/murph213/anaconda3/envs/torchdrug/lib/python3.8/site-packages/torch_scatter/_version.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
rmurphy2718commented, Aug 12, 2021

I finally got an installation that works. I think the key points were to be careful to use the supported version of PyTorch, install the correct torch-scatter for that PyTorch version, and to build from source using pip (within conda). Below are my steps for my CPU install.

conda create -n td_test python=3.8

pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html

# From https://github.com/rusty1s/pytorch_scatter
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+cpu.html

conda install -c conda-forge rdkit

mkdir ~/torch_drug_test

git clone https://github.com/DeepGraphLearning/torchdrug

cd torchdrug

Then, istall the other packages in requirements.txt (but torch and torch-scatter are already installed). Next,

python setup.py install

Also, this happened to make it hard to use Jupyter Lab, so I followed these steps:

conda install -c conda-forge jupyterlab
conda install ipykernel
ipython kernel install --user

from https://stackoverflow.com/questions/53004311/how-to-add-conda-environment-to-jupyter-lab

3reactions
yrq3027commented, Aug 25, 2021

I finally got an installation that works. I think the key points were to be careful to use the supported version of PyTorch, install the correct torch-scatter for that PyTorch version, and to build from source using pip (within conda). Below are my steps for my CPU install.

conda create -n td_test python=3.8

pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html

# From https://github.com/rusty1s/pytorch_scatter
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+cpu.html

conda install -c conda-forge rdkit

mkdir ~/torch_drug_test

git clone https://github.com/DeepGraphLearning/torchdrug

cd torchdrug

Then, istall the other packages in requirements.txt (but torch and torch-scatter are already installed). Next,

python setup.py install

Also, this happened to make it hard to use Jupyter Lab, so I followed these steps:

conda install -c conda-forge jupyterlab
conda install ipykernel
ipython kernel install --user

from https://stackoverflow.com/questions/53004311/how-to-add-conda-environment-to-jupyter-lab

Thank u

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can i fix a GeoDjango OSError: undefined Symbol?
The ultimate cause of the problem is that the version of GEOS that was installed previously didn't get deinstalled:
Read more >
"undefined symbol" errors when running samples - PDFTron
"undefined symbol" errors when running samples. Make sure your alias for python is set to python2 if using Python 2.x or python3 if...
Read more >
1829790 – libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl ...
I would open a bug report upstream to stop doing this stupdi library interposing on all systems and do it only where the...
Read more >
Undefined symbol pytorch 1.7.0 and above
Everything is clean with the new setup. Now install PyTorch 1.9.0 everything goes well no error message from pip pip3 install torch==1.9.0+cpu ...
Read more >
Undefined Symbols (Linker and Libraries Guide)
When generating an executable output file, the link-editor's default behavior is to terminate with an appropriate error message should any symbols remain ...
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