rdkit / OCEAN

OCEAN - Optimized Cross rEActivity estimatioN
11 stars 7 forks source link

Clarity on Python version for Ocean #6

Closed acnash closed 3 years ago

acnash commented 3 years ago

Hi all,

I've just finished installing all dependencies and databases for OCEAN on a fresh and clean Ubuntu build. Please note, I've done all installation and postgresql inside a conda environment.

Unfortunately, when I execute python manage.py syncdb I get the error:

.....
ModuleNotFoundError: No module named 'SimilarityMaps'

I fixed this by replacing the line import SimilarityMaps as SM in settings.py with:

from rdkit.Chem.Draw import SimilarityMaps as SM

I then ended up with a SyntaxError: invalid syntax for a line with an old print statement print "loaded {0}.....

Only based on my experience, this error is associated with old code written in Python2.* - yet I can't find on the git page what version of Python I should be using. Is the latest python ok to use, or redo everything in python2?

Update I cleaned everything off the machine and started again but this time with Python2.7. Unfortunately, now I end up with the error: ImportError: No module named ocean.settings when I execute python manage.py synchdb

wolfguidobolick commented 3 years ago

Hi Anthony,

OCEAN was written using python 2.7.. The error-messages you got are related to changes within RDKit since version 2015.03.1 and incompatibilities between Python 2.7 and 3.x. I'd recommend to use Python 2.7 and install the required packages as listed on the Readme.md of the OCEAN project.

 

I hope this helps!

 

Cheers,

Guido

   

Gesendet: Montag, 21. Juni 2021 um 17:14 Uhr Von: "Anthony Nash" @.> An: "rdkit/OCEAN" @.> Cc: "Subscribed" @.***> Betreff: [rdkit/OCEAN] Clarity on Python version for Ocean (#6)

 

Hi all,

I've just finished installing all dependencies and databases for OCEAN on a fresh and clean Ubuntu build. Please note, I've done all installation and postgresql inside a conda environment.

Unfortunately, when I execute python manage.py syncdb I get the error:

..... ModuleNotFoundError: No module named 'SimilarityMaps'

I fixed this by replacing the line import SimilarityMaps as SM in settings.py with:

from rdkit.Chem.Draw import SimilarityMaps as SM

I then ended up with a SyntaxError: invalid syntax for a line with an old print statement print "loaded {0}.....

Only based on my experience, this error is associated with old code written in Python2.* - yet I can't find on the git page what version of Python I should be using. Is the latest python ok to use, or redo everything in python2? Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

acnash commented 3 years ago

Hi Guido,

Thanks for the reply. I've started working on installing the older version of RDKit, but sadly it's having a issue finding boost (installed). When running make I get the boost error:

 6%] Building CXX object Code/DataStructs/Wrap/CMakeFiles/cDataStructs.dir/DataStructs.cpp.o
/home/anthony/RDKit/Code/DataStructs/Wrap/DataStructs.cpp:18:10: fatal error: boost/python/numeric.hpp: No such file or directory
 #include <boost/python/numeric.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Code/DataStructs/Wrap/CMakeFiles/cDataStructs.dir/build.make:63: Code/DataStructs/Wrap/CMakeFiles/cDataStructs.dir/DataStructs.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2242: Code/DataStructs/Wrap/CMakeFiles/cDataStructs.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

My LD_LIBRARY_PATH is: /home/anthony/RDKit/lib:/home/anthony/anaconda3/envs/OCEAN27/lib/ My RDBASE is: /home/anthony/RDKit I don't know if I've set the location of the boost library correctly. It's quite hard to make out where boost was installed. I ran a Linux find and given that I'm inside a conda environment the above directory structure is my best guess (and it exists, of course).

During the cmake I see the following output:

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.39.0") found components: python 
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.39.0") found components: regex 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/anthony/RDKit/build

I looked for boost/python/numeric.hpp and only found these files:

/home/anthony/boost_1_76_0/libs/hana/test/_include/support/numeric.hpp /home/anthony/boost_1_76_0/libs/locale/src/util/numeric.hpp /home/anthony/boost_1_76_0/boost/gil/image_processing/numeric.hpp /home/anthony/boost_1_76_0/boost/lambda/numeric.hpp /home/anthony/boost_1_76_0/boost/range/numeric.hpp /home/anthony/boost_1_76_0/boost/spirit/home/x3/numeric.hpp /home/anthony/boost_1_76_0/boost/spirit/home/karma/numeric.hpp /home/anthony/boost_1_76_0/boost/spirit/home/qi/numeric.hpp /home/anthony/boost_1_76_0/boost/safe_numerics/concept/numeric.hpp

/home/anthony/anaconda3/envs/OCEAN27/include/boost/lambda/numeric.hpp /home/anthony/anaconda3/envs/OCEAN27/include/boost/range/numeric.hpp /home/anthony/anaconda3/envs/OCEAN27/include/boost/spirit/home/x3/numeric.hpp /home/anthony/anaconda3/envs/OCEAN27/include/boost/spirit/home/karma/numeric.hpp /home/anthony/anaconda3/envs/OCEAN27/include/boost/spirit/home/qi/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/lambda/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/range/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/spirit/home/x3/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/spirit/home/karma/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/spirit/home/qi/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/lambda/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/range/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/spirit/home/x3/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/spirit/home/karma/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/spirit/home/qi/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/gil/image_processing/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/lambda/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/range/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/spirit/home/x3/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/spirit/home/karma/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/spirit/home/qi/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/safe_numerics/concept/numeric.hpp /usr/include/boost/gil/image_processing/numeric.hpp /usr/include/boost/lambda/numeric.hpp /usr/include/boost/range/numeric.hpp /usr/include/boost/spirit/home/x3/numeric.hpp /usr/include/boost/spirit/home/karma/numeric.hpp /usr/include/boost/spirit/home/qi/numeric.hpp /usr/include/boost/safe_numerics/concept/numeric.hpp

Any ideas? Or do you know whether there is a beautiful all in one installation file that holds all the dependencies for OCEAN to save me performing Linux surgery?

Many thanks Anthony

wolfguidobolick commented 3 years ago

Hi Anthony,

I think the most conventient way to try OCEAN would be to use the virtual machine myCHEMBL 20 (which is a bit outdated) http://ftp.ebi.ac.uk/pub/databases/chembl/VM/myChEMBL/releases/myChEMBL-20_0/ . Most of the required libraries are already available there. Also, there is a section in the README.MD (https://github.com/rdkit/OCEAN#installation-using-mychembl-vm) describing how to install OCEAN within the myCHEMBL VM.

I hope this helps.

 

regards,

Guido

 

Gesendet: Donnerstag, 01. Juli 2021 um 21:33 Uhr Von: "Anthony Nash" @.> An: "rdkit/OCEAN" @.> Cc: "Wolf-Guido Bolick" @.>, "Comment" @.> Betreff: Re: [rdkit/OCEAN] Clarity on Python version for Ocean (#6)

 

Hi Guido,

Thanks for the reply. I've started working on installing the older version of RDKit, but sadly it's having a issue finding boost (installed). When running make I get the boost error:

6%] Building CXX object Code/DataStructs/Wrap/CMakeFiles/cDataStructs.dir/DataStructs.cpp.o /home/anthony/RDKit/Code/DataStructs/Wrap/DataStructs.cpp:18:10: fatal error: boost/python/numeric.hpp: No such file or directory

include <boost/python/numeric.hpp>

     ^~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated. make[2]: [Code/DataStructs/Wrap/CMakeFiles/cDataStructs.dir/build.make:63: Code/DataStructs/Wrap/CMakeFiles/cDataStructs.dir/DataStructs.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:2242: Code/DataStructs/Wrap/CMakeFiles/cDataStructs.dir/all] Error 2 make: *** [Makefile:163: all] Error 2

My LD_LIBRARY_PATH is: /home/anthony/RDKit/lib:/home/anthony/anaconda3/envs/OCEAN27/lib/ My RDBASE is: /home/anthony/RDKit

During the cmake I see the following output:

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.39.0") found components: python -- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.39.0") found components: regex -- Configuring done -- Generating done -- Build files have been written to: /home/anthony/RDKit/build

I looked for boost/python/numeric.hpp and only found these files:

/home/anthony/boost_1_76_0/libs/hana/test/_include/support/numeric.hpp /home/anthony/boost_1_76_0/libs/locale/src/util/numeric.hpp /home/anthony/boost_1_76_0/boost/gil/image_processing/numeric.hpp /home/anthony/boost_1_76_0/boost/lambda/numeric.hpp /home/anthony/boost_1_76_0/boost/range/numeric.hpp /home/anthony/boost_1_76_0/boost/spirit/home/x3/numeric.hpp /home/anthony/boost_1_76_0/boost/spirit/home/karma/numeric.hpp /home/anthony/boost_1_76_0/boost/spirit/home/qi/numeric.hpp /home/anthony/boost_1_76_0/boost/safe_numerics/concept/numeric.hpp

/home/anthony/anaconda3/envs/OCEAN27/include/boost/lambda/numeric.hpp /home/anthony/anaconda3/envs/OCEAN27/include/boost/range/numeric.hpp /home/anthony/anaconda3/envs/OCEAN27/include/boost/spirit/home/x3/numeric.hpp /home/anthony/anaconda3/envs/OCEAN27/include/boost/spirit/home/karma/numeric.hpp /home/anthony/anaconda3/envs/OCEAN27/include/boost/spirit/home/qi/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/lambda/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/range/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/spirit/home/x3/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/spirit/home/karma/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.68.0-h11c811c_1000/include/boost/spirit/home/qi/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/lambda/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/range/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/spirit/home/x3/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/spirit/home/karma/numeric.hpp /home/anthony/anaconda3/pkgs/libboost-1.67.0-h46d08c1_4/include/boost/spirit/home/qi/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/gil/image_processing/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/lambda/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/range/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/spirit/home/x3/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/spirit/home/karma/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/spirit/home/qi/numeric.hpp /home/anthony/anaconda3/pkgs/boost-cpp-1.74.0-h312852a_4/include/boost/safe_numerics/concept/numeric.hpp /usr/include/boost/gil/image_processing/numeric.hpp /usr/include/boost/lambda/numeric.hpp /usr/include/boost/range/numeric.hpp /usr/include/boost/spirit/home/x3/numeric.hpp /usr/include/boost/spirit/home/karma/numeric.hpp /usr/include/boost/spirit/home/qi/numeric.hpp /usr/include/boost/safe_numerics/concept/numeric.hpp

Any ideas? Or do you know whether there is a beautiful all in one installation file that holds all the dependencies for OCEAN to save me performing Linux surgery?

Many thanks Anthony

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

acnash commented 3 years ago

Hi Guido,

Thank you very much for your help. I've decided to go down the MyChEMBL route, it's almost working, but even that on a fresh machine is facing issues. I'm going to start a new Issue related to the installation instruction.

Thanks for your help. Anthony