conda-forge / rdkit-feedstock

A conda-smithy repository for rdkit.
BSD 3-Clause "New" or "Revised" License
8 stars 21 forks source link

"undefined symbol" error when importing rdkit.Chem in fresh conda installation #111

Open mgarort opened 1 year ago

mgarort commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

Dear RDKit conda-forge team,

I have encountered an issue related to the Boost library that prevents me to import Chem. Specifically, when I attempt to run the line import rdkit.Chem as Chem, the following error appears:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

     10 import torch
     11 import rdkit
---> 12 import rdkit.Chem as Chem
     13 from rdkit import DataStructs
     14 from itertools import product

File ~/housekeeping/miniconda3/envs/dc_gpu/lib/python3.9/site-packages/rdkit/Chem/__init__.py:23, in <module>
     21 _HasSubstructMatchStr = rdchem._HasSubstructMatchStr
     22 from rdkit.Chem.rdchem import *
---> 23 from rdkit.Chem.rdmolfiles import *
     24 from rdkit.Chem.rdmolops import *
     25 from rdkit.Chem.rdCIPLabeler import *

ImportError: /home/mg770/housekeeping/miniconda3/envs/dc_gpu/lib/python3.9/site-packages/rdkit/Chem/../../../../libRDK
itmaeparser.so.1: undefined symbol: _ZN5boost9iostreams4zlib8deflatedE

As far as I can see, this is exactly the same bug as in issue #93. According to the issue page it is fixed, but I am still getting it in a fresh conda installation. I have encountered the error when installing RDKit in a Python 3.7, 3.8 and 3.9 environments. In a different project I fixed this error by installing RDKit in a Python 3.10 environment, but unfortunately in this project I cannot use 3.10 because of compatibility issues.

I am installing from conda-forge, which is the recommended channel to use in the RDKit installation page. Could you let me know if there is anything I can do to avoid this error?

Thanks a lot in advance.


Specifications

Installed packages

# packages in environment at /home/mg770/housekeeping/miniconda3/envs/dc_gpu:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             5.1                       1_gnu  
asttokens                 2.0.5              pyhd3eb1b0_0  
backcall                  0.2.0              pyhd3eb1b0_0  
blas                      1.0                         mkl  
boost                     1.74.0           py39h5472131_5    conda-forge
boost-cpp                 1.74.0               h359cf19_6    conda-forge
bottleneck                1.3.5            py39h7deecbd_0  
brotlipy                  0.7.0           py39h27cfd23_1003  
bzip2                     1.0.8                h7b6447c_0  
ca-certificates           2022.9.24            ha878542_0    conda-forge
cairo                     1.16.0               h19f5f5c_2  
certifi                   2022.9.24          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1           py39h74dc2b5_0  
charset-normalizer        2.0.4              pyhd3eb1b0_0  
cryptography              37.0.1           py39h9ce1e76_0  
cudatoolkit               11.3.1               h2bc3f7f_2  
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
decorator                 5.1.1              pyhd3eb1b0_0  
deepchem                  2.6.1              pyhd8ed1ab_0    conda-forge
dgl-cuda11.3              0.9.1                    py39_0    dglteam
dockbiotic                0.0.1                     dev_0    <develop>
dockstring                0.2.0                    pypi_0    pypi
executing                 0.8.3              pyhd3eb1b0_0  
expat                     2.4.9                h6a678d5_0  
ffmpeg                    4.2.2                h20bf706_0  
fftw                      3.3.9                h27cfd23_1  
fontconfig                2.14.0               h8e229c2_0    conda-forge
freetype                  2.11.0               h70c0345_0  
giflib                    5.2.1                h7b6447c_0  
glib                      2.69.1               h4ff587b_1  
gmp                       6.2.1                h295c915_3  
gnutls                    3.6.15               he1e5248_0  
icu                       69.1                 h9c3ff4c_0    conda-forge
idna                      3.3                pyhd3eb1b0_0  
intel-openmp              2021.4.0          h06a4308_3561  
ipython                   8.4.0            py39h06a4308_0  
jedi                      0.18.1           py39h06a4308_1  
joblib                    1.1.0              pyhd3eb1b0_0  
jpeg                      9e                   h7f8727e_0  
kiwisolver                1.4.2            py39h295c915_0  
lame                      3.100                h7b6447c_0  
lcms2                     2.12                 h3be6417_0  
ld_impl_linux-64          2.38                 h1181459_1  
lerc                      3.0                  h295c915_0  
libdeflate                1.8                  h7f8727e_5  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 11.2.0               h1234567_1  
libgfortran-ng            11.2.0               h00389a5_1  
libgfortran5              11.2.0               h1234567_1  
libgomp                   11.2.0               h1234567_1  
libidn2                   2.3.2                h7f8727e_0  
libopus                   1.3.1                h7b6447c_0  
libpng                    1.6.37               hbc83047_0  
libstdcxx-ng              11.2.0               h1234567_1  
libtasn1                  4.16.0               h27cfd23_0  
libtiff                   4.4.0                hecacb30_0  
libunistring              0.9.10               h27cfd23_0  
libuuid                   2.32.1            h7f98852_1000    conda-forge
libvpx                    1.7.0                h439df22_0  
libwebp                   1.2.4                h11a3e52_0  
libwebp-base              1.2.4                h5eee18b_0  
libxcb                    1.15                 h7f8727e_0  
lz4-c                     1.9.3                h295c915_1  
matplotlib-base           3.4.3            py39h2fa2bec_2    conda-forge
matplotlib-inline         0.1.6            py39h06a4308_0  
mkl                       2021.4.0           h06a4308_640  
mkl-service               2.4.0            py39h7f8727e_0  
mkl_fft                   1.3.1            py39hd3c417c_0  
mkl_random                1.2.2            py39h51133e4_0  
ncurses                   6.3                  h5eee18b_3  
nettle                    3.7.3                hbbd107a_1  
networkx                  2.8.4            py39h06a4308_0  
numexpr                   2.8.3            py39h807cd23_0  
numpy                     1.23.1           py39h6c91a56_0  
numpy-base                1.23.1           py39ha15fc14_0  
openh264                  2.1.1                h4ff587b_0  
openssl                   1.1.1q               h7f8727e_0  
packaging                 21.3               pyhd3eb1b0_0  
pandas                    1.4.4            py39h6a678d5_0  
parso                     0.8.3              pyhd3eb1b0_0  
pcre                      8.45                 h9c3ff4c_0    conda-forge
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pillow                    9.2.0            py39hace64e9_1  
pip                       22.2.2           py39h06a4308_0  
pixman                    0.40.0               h36c2ea0_0    conda-forge
prompt-toolkit            3.0.20             pyhd3eb1b0_0  
psutil                    5.9.0            py39h5eee18b_0  
ptyprocess                0.7.0              pyhd3eb1b0_2  
pure_eval                 0.2.2              pyhd3eb1b0_0  
pycairo                   1.21.0           py39h0934665_1    conda-forge
pycparser                 2.21               pyhd3eb1b0_0  
pygments                  2.11.2             pyhd3eb1b0_0  
pyopenssl                 22.0.0             pyhd3eb1b0_0  
pyparsing                 3.0.9            py39h06a4308_0  
pysocks                   1.7.1            py39h06a4308_0  
python                    3.9.13               haa1d7c7_2  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python_abi                3.9                      2_cp39    conda-forge
pytorch                   1.12.1          py3.9_cuda11.3_cudnn8.3.2_0    pytorch
pytorch-mutex             1.0                        cuda    pytorch
pytz                      2022.1           py39h06a4308_0  
rdkit                     2022.03.2        py39h89e00b9_0    conda-forge
readline                  8.1.2                h7f8727e_1  
reportlab                 3.5.68           py39he59360d_1    conda-forge
requests                  2.28.1           py39h06a4308_0  
scikit-learn              1.1.2            py39h6a678d5_0  
scipy                     1.9.1            py39h14f4228_0  
setuptools                63.4.1           py39h06a4308_0  
six                       1.16.0             pyhd3eb1b0_1  
sqlalchemy                1.3.24           py39hb9d737c_1    conda-forge
sqlite                    3.39.3               h5082296_0  
stack_data                0.2.0              pyhd3eb1b0_0  
threadpoolctl             2.2.0              pyh0d69192_0  
tk                        8.6.12               h1ccaba5_0  
torchaudio                0.12.1               py39_cu113    pytorch
torchvision               0.13.1               py39_cu113    pytorch
tornado                   6.1              py39hb9d737c_3    conda-forge
tqdm                      4.64.1           py39h06a4308_0  
traitlets                 5.1.1              pyhd3eb1b0_0  
typing_extensions         4.3.0            py39h06a4308_0  
tzdata                    2022c                h04d1e81_0  
urllib3                   1.26.11          py39h06a4308_0  
wcwidth                   0.2.5              pyhd3eb1b0_0  
wheel                     0.37.1             pyhd3eb1b0_0  
x264                      1!157.20191217       h7b6447c_0  
xz                        5.2.6                h5eee18b_0  
zlib                      1.2.12               h5eee18b_3  
zstd                      1.5.2                ha4553b6_0

Environment info

active environment : dc_gpu
    active env location : /home/mg770/housekeeping/miniconda3/envs/dc_gpu
            shell level : 1
       user config file : /home/mg770/.condarc
 populated config files : /home/mg770/.condarc
          conda version : 4.9.2
    conda-build version : not installed
         python version : 3.8.5.final.0
       virtual packages : __glibc=2.17=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/mg770/housekeeping/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/mg770/housekeeping/miniconda3/pkgs
                          /home/mg770/.conda/pkgs
       envs directories : /home/mg770/housekeeping/miniconda3/envs
                          /home/mg770/.conda/envs
               platform : linux-64
             user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Linux/3.10.0-1160.71.1.el7.x86_64 scientific/7.7 glibc/2.17
                UID:GID : 10549:10549
             netrc file : None
           offline mode : False
peizhenbai commented 1 year ago

The same issue we encountered in our package build recently. Here is our action test error: https://github.com/pykale/pykale/actions/runs/3286174993/jobs/5413999571. Hope it can help your team to debug the problem. Thanks.

mgarort commented 1 year ago

Hi @pz-white thank you for your comment. In case it is of any help, using Python 3.10 seems to allow you to sidestep the issue. (Unfortunately I cannot use Python 3.10, so I cannot avoid the problem.)

peizhenbai commented 1 year ago

Hi @mgarort thanks for your great suggestion. We cannot also only use Python 3.10 since we need to ensure our package build is passed for all main Python version.

mgarort commented 1 year ago

It seems that the Python 3.6 conda-forge version of RDKit also works. So, to recap: