rdkit / rdkit

The official sources for the RDKit library
BSD 3-Clause "New" or "Revised" License
2.63k stars 874 forks source link

rkit compiled for python 2.7 wont run #2033

Open SRaent opened 6 years ago

SRaent commented 6 years ago

I am using Manjaro I3 (Arch) and compile rdkit from source as described here https://www.rdkit.org/docs/Install.html I also installed boost as was described (version boost_1_67_0). i installed rdkit fro python 2.7, by using the command: "cmake -D PYTHON_LIBRARY=/usr/lib/python2.7/config/libpython2.7.so -D PYTHON_INCLUDE_DIR=/usr/include/python2.7/ -D PYTHON_EXECUTABLE=/usr/bin/python2.7 -DBOOST_ROOT=/usr/local/boost_1_67_0 .."

"import rdkit" in python 2.7 produces:

import rdkit Traceback (most recent call last): File "", line 1, in File "/home/moritz/rdkit-Release_2018_03_4/rdkit/init.py", line 2, in from .rdBase import rdkitVersion as version ImportError: libRDKitRDBoost.so.1: cannot open shared object file: No such file or directory

greglandrum commented 6 years ago

I'm guessing that the problem is that you haven't set your LD_LIBRARY_PATH to point to $RDBASE/lib

SRaent commented 6 years ago

in the cmake command?

greglandrum commented 6 years ago

No, in the shell where you are running python. The environment variables you need to set are described here: https://www.rdkit.org/docs/Install.html#building-the-rdkit

greglandrum commented 6 years ago

And just a general comment: unless you have a specific reason to want to compile the RDKit from source, it's almost always easier to install/use it from inside anaconda python.

SRaent commented 6 years ago

i tried installing it with miniconda and it did not work. i executed LD_LIBRARY_PATH=/.../rdkit-Release_2018_03_4/lib/ and it did not change a thing. what i forgot to mention in the original post is, that i have to run: "import sys" "sys.path.append("$RDBASE/")" otherwise python just sayes : ">>> rdkit Traceback (most recent call last): File "", line 1, in NameError: name 'rdkit' is not defined"

SRaent commented 6 years ago

i recompiled the whole thing with the environment variables set correctly and i still get the same error

SRaent commented 6 years ago

is there a support page where i can ask for help or something? i have no idea what i am doing wrong. i checked the enviroment variables twice and recompiled everything now.

greglandrum commented 6 years ago

You could try the rdkit-discuss mailing list (https://sourceforge.net/projects/rdkit/lists/rdkit-discuss). Things like this aren't easy to diagnose remotely

But if you installed the rdkit with "conda install" into a conda environment, activated that environment, and it still didn't work then something deeper is going on. What's the error message there?

j-adamczyk commented 1 week ago

@SRaent support for Python 2.7 ended almost 5 years ago, so this issue can probably be closed?