用 py2app 打包 Python 项目总是报: module 'itk' has no attribute 'Image'这个错误

2018-11-19 10:03:22 +08:00
 ccking

Traceback (most recent call last): File "/Users/admin/Developer/dist/launcher.app/Contents/Resources/boot.py", line 103, in <module> _run() File "/Users/admin/Developer/dist/launcher.app/Contents/Resources/boot.py", line 82, in _run exec(compile(source, path, 'exec'), globals(), globals()) File "/Users/admin/Developer/dist/launcher.app/Contents/Resources/launcher.py", line 21, in <module> from app.main import begin File "<frozen importlib._bootstrap="">", line 971, in _find_and_load File "<frozen importlib._bootstrap="">", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656, in _load_unlocked File "<frozen importlib._bootstrap="">", line 626, in _load_backward_compatible File "app/main.pyc", line 16, in <module> File "<frozen importlib._bootstrap="">", line 971, in _find_and_load File "<frozen importlib._bootstrap="">", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656, in _load_unlocked File "<frozen importlib._bootstrap="">", line 626, in _load_backward_compatible File "app/defs/init.pyc", line 1, in <module> File "<frozen importlib._bootstrap="">", line 971, in _find_and_load File "<frozen importlib._bootstrap="">", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656, in _load_unlocked File "<frozen importlib._bootstrap="">", line 626, in _load_backward_compatible File "app/defs/defs.pyc", line 5, in <module> File "<frozen importlib._bootstrap="">", line 971, in _find_and_load File "<frozen importlib._bootstrap="">", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656, in _load_unlocked File "<frozen importlib._bootstrap="">", line 626, in _load_backward_compatible File "bmutils/utils.pyc", line 25, in <module> File "<frozen importlib._bootstrap="">", line 971, in _find_and_load File "<frozen importlib._bootstrap="">", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656, in _load_unlocked File "<frozen importlib._bootstrap="">", line 626, in _load_backward_compatible File "bmutils/insighttoolkit/init.pyc", line 1, in <module> File "<frozen importlib._bootstrap="">", line 971, in _find_and_load File "<frozen importlib._bootstrap="">", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656, in _load_unlocked File "<frozen importlib._bootstrap="">", line 626, in _load_backward_compatible File "bmutils/insighttoolkit/utils.pyc", line 5, in <module> File "<frozen importlib._bootstrap="">", line 971, in _find_and_load File "<frozen importlib._bootstrap="">", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656, in _load_unlocked File "<frozen importlib._bootstrap="">", line 626, in _load_backward_compatible File "bmutils/insighttoolkit/defs.pyc", line 3, in <module> File "bmutils/insighttoolkit/defs.pyc", line 4, in ItkTypes File "itkLazy.pyc", line 40, in getattribute AttributeError: module 'itk' has no attribute 'Image'</module></frozen></frozen></frozen></frozen></module></frozen></frozen></frozen></frozen></module></frozen></frozen></frozen></frozen></module></frozen></frozen></frozen></frozen></module></frozen></frozen></frozen></frozen></module></frozen></frozen></frozen></frozen></module></frozen></frozen></frozen></frozen></module></module>

1753 次点击
所在节点    Python
2 条回复
cbiqih
2018-11-21 15:47:25 +08:00
Traceback (most recent call last):
File "/Users/admin/Developer/dist/launcher.app/Contents/Resources/boot.py", line 103,
in <module> _run()
File "/Users/admin/Developer/dist/launcher.app/Contents/Resources/boot.py", line 82,
in _run exec(compile(source, path, 'exec'), globals(), globals())
File "/Users/admin/Developer/dist/launcher.app/Contents/Resources/launcher.py", line 21,
in <module> from app.main import begin
File "<frozen importlib._bootstrap="">", line 971,
in _find_and_load
File "<frozen importlib._bootstrap="">", line 955,
in _find_and_load_unlocked
File "<frozen importlib._bootstrap="">", line 656,
in _load_unlocked File "<frozen importlib._bootstrap="">", line 626,
in _load_backward_compatible File "app/main.pyc", line 16,
in <module> File "<frozen importlib._bootstrap="">", line 971,
in _find_and_load File "<frozen importlib._bootstrap="">", line 955,
in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656,
in _load_unlocked File "<frozen importlib._bootstrap="">", line 626,
in _load_backward_compatible File "app/defs/init.pyc", line 1,
in <module> File "<frozen importlib._bootstrap="">", line 971,
in _find_and_load File "<frozen importlib._bootstrap="">", line 955,
in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656,
in _load_unlocked File "<frozen importlib._bootstrap="">", line 626,
in _load_backward_compatible File "app/defs/defs.pyc", line 5,
in <module> File "<frozen importlib._bootstrap="">", line 971,
in _find_and_load File "<frozen importlib._bootstrap="">", line 955,
in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656,
in _load_unlocked File "<frozen importlib._bootstrap="">", line 626,
in _load_backward_compatible File "bmutils/utils.pyc", line 25,
in <module> File "<frozen importlib._bootstrap="">", line 971,
in _find_and_load File "<frozen importlib._bootstrap="">", line 955,
in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656,
in _load_unlocked File "<frozen importlib._bootstrap="">", line 626,
in _load_backward_compatible File "bmutils/insighttoolkit/init.pyc", line 1,
in <module> File "<frozen importlib._bootstrap="">", line 971,
in _find_and_load File "<frozen importlib._bootstrap="">", line 955,
in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656,
in _load_unlocked File "<frozen importlib._bootstrap="">", line 626,
in _load_backward_compatible File "bmutils/insighttoolkit/utils.pyc", line 5,
in <module> File "<frozen importlib._bootstrap="">", line 971,
in _find_and_load File "<frozen importlib._bootstrap="">", line 955,
in _find_and_load_unlocked File "<frozen importlib._bootstrap="">", line 656,
in _load_unlocked File "<frozen importlib._bootstrap="">", line 626,
in _load_backward_compatible File "bmutils/insighttoolkit/defs.pyc", line 3,
in <module> File "bmutils/insighttoolkit/defs.pyc", line 4,
in ItkTypes File "itkLazy.pyc", line 40,
in getattribute AttributeError: module 'itk' has no attribute 'Image'
cbiqih
2018-11-21 15:48:11 +08:00
帮楼主左下格式化

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/509130

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX