计算化学公社

 找回密码 Forget password
 注册 Register
Views: 13294|回复 Reply: 5
打印 Print 上一主题 Last thread 下一主题 Next thread

[GROMACS] 求助,伞状取样,setupUmbrella.py脚本,提示出错

[复制链接 Copy URL]

48

帖子

0

威望

451

eV
积分
499

Level 3 能力者

跳转到指定楼层 Go to specific reply
楼主
伞状取样,setupUmbrella.py脚本,提示出错。./setupUmbrella.py summary_distances.dat 0.2 run-umbrella.sh &> caught-output.txt       
一运行,就提示错误:
  File "./setupUmbrella.py", line 156
    print "Creating frame-specific output for files:"
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Creating frame-specific output for files:")?


这个怎么解决

setupUmbrella.py

5.74 KB, 下载次数 Times of downloads: 12

222

帖子

5

威望

2597

eV
积分
2919

Level 5 (御坂)

2#
发表于 Post on 2020-7-29 11:56:51 | 只看该作者 Only view this author
本帖最后由 liuyuje714 于 2020-7-29 11:58 编辑

默认使用python2;或者更改一下脚本中的所有print部分,加上括号,然后还要把61行的keys.sort()改成keys = sorted(keys)。附件中我帮你改成了python3的了。

setupUmbrella.py

5.7 KB, 下载次数 Times of downloads: 126

48

帖子

0

威望

451

eV
积分
499

Level 3 能力者

3#
 楼主 Author| 发表于 Post on 2020-7-29 14:35:52 | 只看该作者 Only view this author
liuyuje714 发表于 2020-7-29 11:56
默认使用python2;或者更改一下脚本中的所有print部分,加上括号,然后还要把61行的keys.sort()改成keys =  ...

非常感谢

226

帖子

0

威望

878

eV
积分
1104

Level 4 (黑子)

4#
发表于 Post on 2021-5-30 17:33:59 | 只看该作者 Only view this author
我的依然报错如下,Creating frame-specific output for files:
run-umbrella.sh
Traceback (most recent call last):
  File "./setupUmbrella.py", line 182, in <module>
    out = main()
  File "./setupUmbrella.py", line 161, in main
    createOutputFile(t,frame,search_string="XXX")
  File "./setupUmbrella.py", line 110, in createOutputFile
    answer = raw_input("%s exists!  Overwrite (y|n)?" % out_file)
NameError: name 'raw_input' is not defined
请问怎么解决呢

48

帖子

0

威望

451

eV
积分
499

Level 3 能力者

5#
 楼主 Author| 发表于 Post on 2021-7-14 11:04:30 | 只看该作者 Only view this author
sun666 发表于 2021-5-30 17:33
我的依然报错如下,Creating frame-specific output for files:
run-umbrella.sh
Traceback (most recent ...

放到linux下还出错吗?还粗错,你就dos2unix下

2

帖子

0

威望

43

eV
积分
45

Level 2 能力者

6#
发表于 Post on 2023-11-30 12:43:52 | 只看该作者 Only view this author
wgg1181543722 发表于 2021-7-14 11:04
放到linux下还出错吗?还粗错,你就dos2unix下

还是有问题

Traceback (most recent call last):
  File "setupUmbrella.py", line 182, in <module>
    out = main()
  File "setupUmbrella.py", line 150, in main
    distance_table = readDistanceFile(distance_file)
  File "setupUmbrella.py", line 49, in readDistanceFile
    value = float(columns[1])
IndexError: list index out of range
~                                    

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2026-2-26 06:08 , Processed in 0.191419 second(s), 29 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list