pymol module 添加到 python 的 import 路径

先查看 pymol module 的路径

$ which pymol
/usr/local/bin/pymol

$ cat /usr/local/bin/pymol
#!/bin/sh
[ "$DISPLAY" == "" ] && export DISPLAY=":0.0"
export PYMOL_PATH="/usr/local/Cellar/pymol/1.8.2.1/libexec/lib/python2.7/site-packages/pymol/pymol_path"
"/usr/local/opt/python/bin/python2.7" "/usr/local/Cellar/pymol/1.8.2.1/libexec/lib/python2.7/site-packages/pymol/__init__.py" "$@"

将 pymol module 的路径添加到 python import 的搜索路径

import sys
sys.path.append("/usr/local/Cellar/pymol/1.8.2.1/libexec/lib/python2.7/site-packages/")

import pymol

你可能感兴趣的:(pymol module 添加到 python 的 import 路径)