先查看 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
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者