|
amber amber.python mdout_analyzer.py miniconda 软连接
运行mdout_analyzer.py的时候遇到一个问题,说Tcl没安装好。
[jawang@gpu3 tcl8.5]$ pythonamber mdout_analyzer.py
2.7.11 |Continuum Analytics, Inc.| (default, Dec 6 2015, 18:08:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
/home/jawang/software/amber16/bin/pythonamber
Traceback (most recent call last):
File "mdout_analyzer.py", line 50, in <module>
root = Tk()
File "/home/jawang/software/amber16/miniconda/lib/python2.7/lib-tk/Tkinter.py", line 1814, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
/opt/anaconda1anaconda2anaconda3/lib/tcl8.5 /home/jawang/software/amber16/lib/tcl8.5 /home/jawang/software/lib/tcl8.5 /home/jawang/software/amber16/library /home/jawang/software/library /home/jawang/software/tcl8.5.18/library /home/jawang/tcl8.5.18/library
This probably means that Tcl wasn't installed properly.
先给出解决方案,
安装amber的时候,会自动安装miniconda,从而安装了相应的python环境,用miniconda 中的python 运行该脚本不报错。
/home/xxx/software/amber16/miniconda/bin/python ~/software/amber16/bin/mdout_analyzer.py
再给出分析过程,
step1 locate init.tcl 发现电脑中是存在该文件的,相关的应该是下面第一个文件,
[xxx@gpu3 bin]$ locate init.tcl
/home/xxx/software/amber16/miniconda/lib/tcl8.5/init.tcl
/home/xxx/software/amber16/miniconda/pkgs/tk-8.5.18-0/lib/tcl8.5/init.tcl
/usr/share/tcl8.5/init.tcl
step2 在这个/home/jawang/software/amber16/lib/tcl8.5下建立软连接init.tcl 依旧报另一个错误
_tkinter.TclError: invalid command name "tcl_findLibrary"
step3 问题应该是还有好多文件没有和amber.python关联
step4 发现amber.python 也是一个软连接
[xxx@gpu3 bin]$ ls amber.python -rtlh
lrwxrwxrwx. 1 xxx xxx 23 Jun 21 2016 amber.python -> ../miniconda/bin/python
step5 tcl在miniconda下面是有的,python在miniconda下面也是有的,因此用miniconda下的python 运行 相应的脚本,应该不会报找不到tcl的错误。
尝试了下,成功。
------------------------------------
软连接不成功的可能原因,调用tcl的时候使用了相对路径;
import sys
print sys.version
print sys.executable
仅仅显示的是软链接的路径
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-20 07:26
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社