无法在 Jupyter 中使用 RDKit 或 iPython
Unable to use RDKit in Jupyter or iPython
我想在 Jupyter 环境中使用 RDKit。但是,在我按照 this document.
中概述的程序进行操作之后
完成流程后,包括获取 jupyter 的内核,我尝试访问 RDKit 并使用它。
(rdkit-test) [user] ~ $ python
Python 3.7.9 (default, Aug 31 2020, 07:22:35)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/Users/user/opt/anaconda3/envs/rdkit-test/bin/python'
>>> import rdkit
>>>
[6]+ Stopped python
直接从测试 anaconda 环境 rdkit-test
,我似乎可以访问 rdkit 并用它进行测试。
现在,我尝试通过 iPython:
访问它
(rdkit-test) [user] ~ $ ipython
Python 3.8.7 (v3.8.7:6503f05dd5, Dec 21 2020, 12:45:15)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.17.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import sys
In [2]: sys.executable
Out[2]: '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8'
In [3]: import rdkit
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-3-6b72bd8913ab> in <module>
----> 1 import rdkit
ModuleNotFoundError: No module named 'rdkit'
我似乎无法访问 rdkit
。我还可以从我的 sys.executable
命令中看到我不在写环境中。
我在 Jupyter notebook 中看到同样的问题:
如何解决此问题并在 Jupyter 或 iPython 中使用 RDKit?
您应该使用 !pip install kora。然后,使用 import kora.install.rdkit.
我想在 Jupyter 环境中使用 RDKit。但是,在我按照 this document.
中概述的程序进行操作之后完成流程后,包括获取 jupyter 的内核,我尝试访问 RDKit 并使用它。
(rdkit-test) [user] ~ $ python
Python 3.7.9 (default, Aug 31 2020, 07:22:35)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/Users/user/opt/anaconda3/envs/rdkit-test/bin/python'
>>> import rdkit
>>>
[6]+ Stopped python
直接从测试 anaconda 环境 rdkit-test
,我似乎可以访问 rdkit 并用它进行测试。
现在,我尝试通过 iPython:
访问它(rdkit-test) [user] ~ $ ipython
Python 3.8.7 (v3.8.7:6503f05dd5, Dec 21 2020, 12:45:15)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.17.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import sys
In [2]: sys.executable
Out[2]: '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8'
In [3]: import rdkit
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-3-6b72bd8913ab> in <module>
----> 1 import rdkit
ModuleNotFoundError: No module named 'rdkit'
我似乎无法访问 rdkit
。我还可以从我的 sys.executable
命令中看到我不在写环境中。
我在 Jupyter notebook 中看到同样的问题:
如何解决此问题并在 Jupyter 或 iPython 中使用 RDKit?
您应该使用 !pip install kora。然后,使用 import kora.install.rdkit.