LoginSignup
0
0

More than 1 year has passed since last update.

python版py3Dmolによる描画にはnodejsをinstall (jupyter-notebookにて)

Posted at

要約

jupyter-notebookにてpy3Dmolによる描画が表示されないときはnodejsをinstallしましょう。

背景

py3Dmolは化学物質や蛋白質の三次元構造を描画するモジュールの1つです。PyPIに載っているリンクからプロジェクトページに移動すると3Dmol.jsとなります。ベースはjavascriptなんでしょうね。

方法

windows10ではコマンドプロンプトで以下のコマンドを実行。linux, macでも同様と思いますが試していません。jupyter-labには拡張が必要とのこと。
pip install nodejs
pip install py3Dmol
次に、python実行環境で以下を実行 (公式tutorialと同じです)。
import py3Dmol
view = py3Dmol.view(query='pdb:1ubq')
view.setStyle({'cartoon':{'color':'spectrum'}})
view
以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0