2

我正在尝试在 python 中访问“rdkit”模块,但我的 python 安装似乎没有找到该模块。我按照这里的建议使用 brew 安装了它。我包括了我用来重现问题的命令。

只是将“/usr/local/Cellar”添加到 python 路径中是一个简单的修复吗?Symlinc 站点包到地窖?坦率地说,我在更新我的 python 时并没有理解 pip 和 brew 之间的区别,所以我的第一个想法是 python 路径不正确。任何建议都非常感谢。

X:~\ python3 Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53)  [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.
>>> import rdkit Traceback (most recent call last):   
File "<stdin>", line 1, in <module> 
ModuleNotFoundError: No module named 'rdkit'

X:~\ which python3
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3

X:~\ python3
Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
    ['', 
'/Library/Frameworks/Python.framework/Versions/3.8/lib/python38.zip', 
'/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8', 
'/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload', 
'/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages']



**@:/usr/local/Cellar\** ls
boost/         gettext/       libffi/        numpy/         sip/
boost-python3/ glew/          libidn2/       openblas/      sqlite/
cmake/         glib/          libmpc/        openssl@1.1/   tcl-tk/
ddclient/      glm/           libpng/        pandoc/        tree/
eigen/         gmp/           libtiff/       pcre/          webp/
fontconfig/    graphviz/      libtool/       pkg-config/    wget/
freeglut/      gts/           libunistring/  pyqt/          xz/
freetype/      icu4c/         mmtf-cpp/      python/
gcc/           isl/           mpfr/          qt/
gd/            jasper/        msgpack/       **rdkit/**
gdbm/          jpeg/          netpbm/        readline/

详细信息:OS Catalina:10.15.3

4

0 回答 0