RDKit 在导入时崩溃笔记本内核

RDKit crashing Notebook Kernel on import

我是这样通过pip安装RDKit的。

pip install rdkit-pypi

每当我导入任何 rdkit 模块时:

from rdkit.Chem.Draw import IPythonConsole

我在 VSCode.

中得到了这个

错误

The kernel '.pyvenv (Python 3.9.7)' died. View Jupyter [log](command:jupyter.viewOutput) for further details.

日志

Visual Studio Code (1.65.0, undefined, desktop)
Jupyter Extension Version: 2022.2.1030672458.
Python Extension Version: 2022.0.1814523869.
User belongs to experiment group 'jupyterTestcf'
User belongs to experiment group 'jupyterEnhancedDataViewer'
Info 20:50:29: ZMQ install verified.
Info 20:50:30: Preferred kernel connection found in cache .jvsc74a57bd0224dc0f14b595f635f86ac70d4b9b15df6150e6ef32625bab47f4fa7a4f3e7b1./home/shahzad/.pyvenv/python./home/shahzad/.pyvenv/python.-m#ipykernel_launcher
Info 20:50:30: PreferredConnection: .jvsc74a57bd0224dc0f14b595f635f86ac70d4b9b15df6150e6ef32625bab47f4fa7a4f3e7b1./home/shahzad/.pyvenv/python./home/shahzad/.pyvenv/python.-m#ipykernel_launcher found for NotebookDocument: ~/Projects/Personal/Python/sentdex_pytorch.ipynb
Info 20:50:30: Early registration of controller for Kernel connection .jvsc74a57bd0224dc0f14b595f635f86ac70d4b9b15df6150e6ef32625bab47f4fa7a4f3e7b1./home/shahzad/.pyvenv/python./home/shahzad/.pyvenv/python.-m#ipykernel_launcher
Info 20:50:30: TargetController found ID: .jvsc74a57bd0224dc0f14b595f635f86ac70d4b9b15df6150e6ef32625bab47f4fa7a4f3e7b1./home/shahzad/.pyvenv/python./home/shahzad/.pyvenv/python.-m#ipykernel_launcher for document ~/Projects/Personal/Python/sentdex_pytorch.ipynb
Info 20:50:30: Setting controller affinity for ~/Projects/Personal/Python/sentdex_pytorch.ipynb .jvsc74a57bd0224dc0f14b595f635f86ac70d4b9b15df6150e6ef32625bab47f4fa7a4f3e7b1./home/shahzad/.pyvenv/python./home/shahzad/.pyvenv/python.-m#ipykernel_launcher
Info 20:50:30: Experiment status for python is {"enabled":true,"optInto":[],"optOutFrom":[]}
Info 20:50:30: Interrupt requested & no kernel.
Info 20:50:30: Setting setActiveController for ~/Projects/Personal/Python/sentdex_pytorch.ipynb
Info 20:50:30: KernelProvider switched kernel to id = .jvsc74a57bd0224dc0f14b595f635f86ac70d4b9b15df6150e6ef32625bab47f4fa7a4f3e7b1./home/shahzad/.pyvenv/python./home/shahzad/.pyvenv/python.-m#ipykernel_launcher
Info 20:50:30: Starting Notebook in kernel.ts id = .jvsc74a57bd0224dc0f14b595f635f86ac70d4b9b15df6150e6ef32625bab47f4fa7a4f3e7b1./home/shahzad/.pyvenv/python./home/shahzad/.pyvenv/python.-m#ipykernel_launcher
Info 20:50:30: Creating raw notebook for ~/Projects/Personal/Python/sentdex_pytorch.ipynb
Info 20:50:30: Getting preferred kernel for ~/Projects/Personal/Python/sentdex_pytorch.ipynb
Info 20:50:30: Computing working directory ~/Projects/Personal/Python/sentdex_pytorch.ipynb
Info 20:50:30: Starting raw kernel .pyvenv (Python 3.9.7) for interpreter ~/.pyvenv/bin/python
Info 20:50:30: installMissingDependencies ~/.pyvenv/bin/python
Info 20:50:30: IPyKernel found previously in this environment ~/.pyvenv/bin/python
Info 20:50:30: Kernel launching with ports 9000,9001,9002,9003,9004. Start port is 9000
Info 20:50:30: Process Execution: > ~/.pyvenv/bin/python -m pip list
> ~/.pyvenv/bin/python -m pip list
Info 20:50:30: Process Execution: > ~/.pyvenv/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> ~/.pyvenv/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
Info 20:50:30: Adding env Variable PYTHONNOUSERSITE to ~/.pyvenv/bin/python
Info 20:50:30: Process Execution: > ~/.pyvenv/bin/python -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"5de861de-2c02-44fb-b111-520515629a30" --shell=9002 --transport="tcp" --iopub=9004 --f=/tmp/tmp-6345dU61mWzzHZx8.json
> ~/.pyvenv/bin/python -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"5de861de-2c02-44fb-b111-520515629a30" --shell=9002 --transport="tcp" --iopub=9004 --f=/tmp/tmp-6345dU61mWzzHZx8.json
Info 20:50:30: Process Execution: cwd: ~/Projects/Personal/Python
cwd: ~/Projects/Personal/Python
Info 20:50:30: Creating controller for jupyter-notebook with interpreter ~/.pyvenv/bin/python3.9
Info 20:50:30: ipykernel version 6.9.1 for ~/.pyvenv/bin/python
Info 20:50:30: ipykernel location ~/.pyvenv/lib/python3.9/site-packages/ipykernel/__init__.py for ~/.pyvenv/bin/python
Info 20:50:30: Process Execution: > ~/.pyvenv/bin/python3.9 -m pip list
> ~/.pyvenv/bin/python3.9 -m pip list
Info 20:50:31: Registering dummy command feature
Warn 20:50:31: StdErr from Kernel Process /home/shahzad/.pyvenv/lib/python3.9/site-packages/traitlets/traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
/home/shahzad/.pyvenv/lib/python3.9/site-packages/traitlets/traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '5de861de-2c02-44fb-b111-520515629a30' instead of 'b"5de861de-2c02-44fb-b111-520515629a30"'.
  warn(

Info 20:50:31: Kernel Output: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing /tmp/tmp-6345dU61mWzzHZx8.json

Info 20:50:31: Raw session started and connected
Started kernel .pyvenv (Python 3.9.7)
Info 20:50:31: Finished connecting 0cb9bd04-94f4-41b9-9b36-ad666d453aa5
Info 20:50:31: Executing silently Code (idle) = import sys\nprint(sys.executable)
Info 20:50:31: Registering dummy command feature
Info 20:50:31: Executing silently Code (completed) = import sys\nprint(sys.executable)
Info 20:50:31: UpdateWorkingDirectoryAndPath in Kernel
Info 20:50:31: Executing silently Code (idle) = import site\nsite.addsitedir(site.getusersitepackages())\nimport os\nimport sys\n%cd "/home/shahzad/Proj
Info 20:50:31: Executing silently Code (completed) = import site\nsite.addsitedir(site.getusersitepackages())\nimport os\nimport sys\n%cd "/home/shahzad/Proj
Info 20:50:31: Waiting for idle on (kernel): 994505ac-0057-4705-924a-62e9b5836ad0 -> idle
Info 20:50:31: Finished waiting for idle on (kernel): 994505ac-0057-4705-924a-62e9b5836ad0 -> idle
Info 20:50:33: Execute Cells request 1
Info 20:50:33: Execute Cell 1 ~/Projects/Personal/Python/sentdex_pytorch.ipynb
Info 20:50:34: Cell 1 executed with state Success
Info 20:53:40: Execute Cells request 8
Info 20:53:40: Execute Cell 8 ~/Projects/Personal/Python/sentdex_pytorch.ipynb
Info 20:53:41: Cancel all remaining cells true || Error
Info 20:53:41: Cancel pending cells
Info 20:53:41: Cell 8 executed with state Error
Info 20:53:51: Creating controller for jupyter-notebook with interpreter ~/.pyvenv/bin/python3.9
Info 20:53:51: Find preferred kernel for ~/Projects/Personal/Python/esol.ipynb with metadata {"orig_nbformat":4,"language_info":{"name":"python"}} & preferred interpreter ~/.pyvenv/bin/python3.9
Info 20:53:51: findKernel found .pyvenv (Python 3.9.7)
Info 20:53:51: PreferredConnection: .jvsc74a57bd01d8f747c75f7a74e15a606d9612deec7108dabb112d8816f978043aee9b36c17./home/shahzad/.pyvenv/bin/python3.9./home/shahzad/.pyvenv/bin/python3.9.-m#ipykernel_launcher found for NotebookDocument: ~/Projects/Personal/Python/esol.ipynb
Info 20:53:51: TargetController found ID: .jvsc74a57bd01d8f747c75f7a74e15a606d9612deec7108dabb112d8816f978043aee9b36c17./home/shahzad/.pyvenv/bin/python3.9./home/shahzad/.pyvenv/bin/python3.9.-m#ipykernel_launcher for document ~/Projects/Personal/Python/esol.ipynb
Info 20:53:51: Setting controller affinity for ~/Projects/Personal/Python/esol.ipynb .jvsc74a57bd01d8f747c75f7a74e15a606d9612deec7108dabb112d8816f978043aee9b36c17./home/shahzad/.pyvenv/bin/python3.9./home/shahzad/.pyvenv/bin/python3.9.-m#ipykernel_launcher
Error 20:53:57: Live Notebook not available for ~/Projects/Personal/Python/esol.ipynb
Error 20:53:58: Live Notebook not available for ~/Projects/Personal/Python/esol.ipynb
Info 20:54:07: Setting setActiveController for ~/Projects/Personal/Python/esol.ipynb
Info 20:54:07: Interrupt requested & no kernel.
Info 20:54:07: Execute Cells request 0
Info 20:54:07: Execute Cell 0 ~/Projects/Personal/Python/esol.ipynb
Info 20:54:07: Starting Notebook in kernel.ts id = .jvsc74a57bd01d8f747c75f7a74e15a606d9612deec7108dabb112d8816f978043aee9b36c17./home/shahzad/.pyvenv/bin/python3.9./home/shahzad/.pyvenv/bin/python3.9.-m#ipykernel_launcher
Info 20:54:07: Creating raw notebook for ~/Projects/Personal/Python/esol.ipynb
Info 20:54:07: Getting preferred kernel for ~/Projects/Personal/Python/esol.ipynb
Info 20:54:07: Computing working directory ~/Projects/Personal/Python/esol.ipynb
Info 20:54:07: Starting raw kernel .pyvenv (Python 3.9.7) for interpreter ~/.pyvenv/bin/python3.9
Info 20:54:07: installMissingDependencies ~/.pyvenv/bin/python3.9
Info 20:54:07: KernelProvider switched kernel to id = .jvsc74a57bd01d8f747c75f7a74e15a606d9612deec7108dabb112d8816f978043aee9b36c17./home/shahzad/.pyvenv/bin/python3.9./home/shahzad/.pyvenv/bin/python3.9.-m#ipykernel_launcher
Info 20:54:07: Process Execution: > ~/.pyvenv/bin/python3.9 -c "import ipykernel"
> ~/.pyvenv/bin/python3.9 -c "import ipykernel"
Info 20:54:07: Kernel launching with ports 9005,9006,9007,9008,9009. Start port is 9000
Info 20:54:07: Process Execution: > ~/.pyvenv/bin/python3.9 -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> ~/.pyvenv/bin/python3.9 -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
Info 20:54:07: Adding env Variable PYTHONNOUSERSITE to ~/.pyvenv/bin/python3.9
Info 20:54:07: Process Execution: > ~/.pyvenv/bin/python3.9 -m ipykernel_launcher --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"a2b5ca94-4372-468e-8eb6-7ec8b3c7c7c5" --shell=9007 --transport="tcp" --iopub=9009 --f=/tmp/tmp-6345I6jezU7f6ygz.json
> ~/.pyvenv/bin/python3.9 -m ipykernel_launcher --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"a2b5ca94-4372-468e-8eb6-7ec8b3c7c7c5" --shell=9007 --transport="tcp" --iopub=9009 --f=/tmp/tmp-6345I6jezU7f6ygz.json
Info 20:54:07: Process Execution: cwd: ~/Projects/Personal/Python
cwd: ~/Projects/Personal/Python
Info 20:54:07: ipykernel version 6.9.1 for ~/.pyvenv/bin/python3.9
Info 20:54:07: ipykernel location ~/.pyvenv/lib/python3.9/site-packages/ipykernel/__init__.py for ~/.pyvenv/bin/python3.9
Warn 20:54:08: StdErr from Kernel Process /home/shahzad/.pyvenv/lib/python3.9/site-packages/traitlets/traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(

Warn 20:54:08: StdErr from Kernel Process /home/shahzad/.pyvenv/lib/python3.9/site-packages/traitlets/traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'a2b5ca94-4372-468e-8eb6-7ec8b3c7c7c5' instead of 'b"a2b5ca94-4372-468e-8eb6-7ec8b3c7c7c5"'.
  warn(

Info 20:54:08: Kernel Output: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing /tmp/tmp-6345I6jezU7f6ygz.json

Info 20:54:08: Raw session started and connected
Started kernel .pyvenv (Python 3.9.7)
Info 20:54:08: Finished connecting 0cb9bd04-94f4-41b9-9b36-ad666d453aa5
Info 20:54:08: Executing silently Code (idle) = import sys\nprint(sys.executable)
Info 20:54:08: Executing silently Code (completed) = import sys\nprint(sys.executable)
Info 20:54:08: UpdateWorkingDirectoryAndPath in Kernel
Info 20:54:08: Executing silently Code (idle) = import site\nsite.addsitedir(site.getusersitepackages())\nimport os\nimport sys\n%cd "/home/shahzad/Proj
Info 20:54:08: Executing silently Code (completed) = import site\nsite.addsitedir(site.getusersitepackages())\nimport os\nimport sys\n%cd "/home/shahzad/Proj
Info 20:54:08: Waiting for idle on (kernel): a60186ad-c85c-40d0-9c3b-d32f43526f3e -> idle
Info 20:54:08: Finished waiting for idle on (kernel): a60186ad-c85c-40d0-9c3b-d32f43526f3e -> idle
Error 20:54:08: Disposing session as kernel process died ExitCode: undefined, Reason: /home/shahzad/.pyvenv/lib/python3.9/site-packages/traitlets/traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
/home/shahzad/.pyvenv/lib/python3.9/site-packages/traitlets/traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'a2b5ca94-4372-468e-8eb6-7ec8b3c7c7c5' instead of 'b"a2b5ca94-4372-468e-8eb6-7ec8b3c7c7c5"'.
  warn(

Info 20:54:08: Dispose Kernel process
Error 20:54:08: Raw kernel process exited code: undefined
Info 20:54:08: Cancel all remaining cells due to dead kernel
Info 20:54:08: Cancel pending cells
Info 20:54:08: Cell 0 executed with state Success


Google Colab 中也发生了同样的情况。好像是rdkit的问题。

刚刚安装了低版本的RDKit,运行正常

pip install rdkit-pypi==2021.9.4

2021.9.5

似乎有问题