【发布时间】:2018-07-28 21:42:28
【问题描述】:
我正在尝试在 ImageJ 中安装 Python 脚本。我的偏好是将脚本与 ImageJ 1.x 一起使用,但如果需要也可以使用 Fiji。
我正在尝试通过将脚本放在插件文件夹中来将其与 ImageJ 1.x 一起使用。该脚本出现在插件菜单中,但是当我尝试运行它时,我得到一个错误,它找不到__future__
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named __future__
这对我来说毫无意义,因为 __future__ 模块被用于导入 with_statement 模块,python 版本被列为:
2.5.4rc1 (2.5:723492dbab02, Feb 8 2013, 10:13:55)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)]
来自__future__ import with_statement 专为与 Python 2.5.x 版本一起使用而设计
https://docs.python.org/3/library/future.html
所以……继续……
我厌倦了使用 Fiji,因为它基于 ImageJ2。
我可以使用File > New > Script .. 将代码粘贴到脚本编辑器中。
代码从那里执行时运行。但是,保存后我无法让它显示在插件菜单中。我试过把它保存到:
Fiji/plugins
Fiji/plugins/Scripts
Fiji/plugins/Scripts/Plugins
文件名中包含_。
我运行的斐济版本是 ImageJ 2.0.0 rc-68/1.52e / Java1.8.0_172(64位)
我正在运行的 ImageJ 1.x 版本是 ImageJ 1.52e / Java1.8.0_172(64 位)
任何帮助将不胜感激。
谢谢
【问题讨论】: