Closed nsantini closed 4 years ago
same thing for em on my Mac...
I fixed it by running:
mkdir -p /Users/nico/Library/Python/3.6/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python3.6/site-packages")' >> /Users/<username>/Library/Python/3.6/lib/python/site-packages/homebrew.pth
Note: this is using python 3.6, change to your version, same with the username of your account
Why isn't the formula doing all this stuffs!!! How am I supposed to know about those... I'm really annoyed by this formula, it's not automatic.
I discovered it by looking into others trying to install python modules with brew, the commands came from the "caveats" in the brew install output from one of the dependencies... so no particularly obvious
Interesting. This really shouldn't be necessary. By any chance are you trying to import rdkit from a different python installation than the homebrew one?
which python3
should give something like /usr/local/bin/python3
And if you run import sys;print(sys.path)
in the python interpreter, you should see /usr/local/lib/python3.6/site-packages
already in there.... (without needing to add the homebrew.pth file)
Thanks, I will try this.
One thing I found is that when I tried to brew install rdkit --with-python3
. I got this:
Warning: rdkit: this formula has no --with-python3 option so it will be ignored!
Forget that, it seems that my homebrew
has some problem.
My python3 works for Homebrew-rdkit
, but I need to install through brew install rdkit/rdkit/rdkit --with-python3
@UnixJunkie Is there any update of this ?
I will try at home
This can be closed.
I can repeatedly install rdkit using these steps:
pip3 install numpy
brew install --HEAD rdkit --with-python3 --with-inchi
This is no panacea, because it does not install a tagged release, but I can live with that for the moment.
This is still an issue for me and my colleague, even with the suggestion from @UnixJunkie above.
@Astrovicis did the brew install work? Can you paste the full log of it. What is the output of 'which python3'?
These days, you can even install a recently tagged version of rdkit:
brew tap rdkit/rdkit
which python3 || brew install python3
pip3 install numpy
brew install rdkit --with-inchi
brew install log:
==> Installing rdkit from rdkit/rdkit
==> Downloading https://github.com/rdkit/rdkit/archive/Release_2019_03_2.tar.gz
Already downloaded: /Users/maxhoward/Library/Caches/Homebrew/downloads/bfc63b18873a7e4cd38cb0629faa183240367686eef85d2251f3351efc03903e--rdkit-Release_2019_03_2.tar.gz
==> cmake -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D
Last 15 lines from /Users/maxhoward/Library/Logs/Homebrew/rdkit/01.cmake:
boost_pythonConfig.cmake
boost_python-config.cmake
Add the installation prefix of "boost_python" to CMAKE_PREFIX_PATH or set
"boost_python_DIR" to a directory containing one of the above files. If
"boost_python" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
/usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
/usr/local/Cellar/cmake/3.15.3/share/cmake/Modules/FindBoost.cmake:443 (find_package)
CMakeLists.txt:255 (find_package)
-- Configuring incomplete, errors occurred!
See also "/tmp/rdkit-20190917-17742-10u5rc/rdkit-Release_2019_03_2/CMakeFiles/CMakeOutput.log".
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/rdkit/homebrew-rdkit/issues
These open issues may also help:
MacOS: ModuleNotFoundError: No module named 'rdkit' https://github.com/rdkit/homebrew-rdkit/issues/50
Installing RDKit on Mac OSX 10.10.2 with java and inchi https://github.com/rdkit/homebrew-rdkit/issues/25
which python3 output:
/usr/local/bin/python3
ok, the problem is that the current version of boost/boost-python in homebrew is not compatible with rdkit. I don't know how to fix this easily.
This one would be nice to prevent this problem in the future: https://github.com/rdkit/homebrew-rdkit/issues/65
There was a related fix in the past: https://github.com/rdkit/rdkit/commit/738fc041629913a2d5b0352766f8b66b38679316 by @mcs07
I suspect the previous version in homebrew was working. I looked the history of this file: https://github.com/Homebrew/homebrew-core/commits/master/Formula/boost.rb That would be boost 1.70.0 or the one just before: boost 1.69.0_2. And I guess the boost-python3 formula's version must also match.
I fixed it by running:
mkdir -p /Users/nico/Library/Python/3.6/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python3.6/site-packages")' >> /Users/<username>/Library/Python/3.6/lib/python/site-packages/homebrew.pth
Note: this is using python 3.6, change to your version, same with the username of your account
with this I still have the same error. MacOS: ModuleNotFoundError: No module named 'rdkit' https://github.com/rdkit/homebrew-rdkit/issues/50
@chenwenjie95 try to use the rdkit install recipe from this PR: https://github.com/rdkit/homebrew-rdkit/pull/73 You need to do a git checkout, checkout the correct branch then add this as a tap to your homebrew.
@chenwenjie95 try this and tell us how it goes (with full log attached as a gist, if necessary):
brew update
which python3 || brew install python3
pip3 install numpy
brew unlink boost || echo boost_not_installed
brew unlink boost-python3 || echo boost-python3_not_installed
brew install rdkit --with-python3
Long time without new feedback so closing. If the problem persists, ask us the reopen the issue.
I still have this problem
Install the new rdkit recipe, not from this tap:
brew uninstall --force rdkit
brew untap rdkit/rdkit
brew update
brew install rdkit
Ive installed with:
brew tap rdkit/rdkit
brew install rdkit --with-python3
and using like:
from rdkit import Chem
Im getting:
Traceback (most recent call last):
File "data_structs.py", line 5, in <module>
from rdkit import Chem
ModuleNotFoundError: No module named 'rdkit'