我有一个名为test.py的简单应用程序:
import tkinter
a=tkinter.Tk()
tkinter.Label(a,text='hello!').pack()
a.mainloop()
我创建了一个名为test的文件夹。我主动virtualenv,make setup.py然后' python3 setup.py py2app'。最后,它显示“完成!”(这意味着py2app工作正常,没有任何问题。)但是当我双击dist目录中的test.app时,它失败了。(测试错误)。你知道为什么会出现这个问题吗?我该如何解决? 当我运行distilled / test.app / Contents / MacOS / test:
时,这是错误消息Contents/MacOS/test ; exit;
Traceback (most recent call last):
File > "/Users/dariushmazlumi/Desktop/test/dist/test.app/Contents/Resources/__boo> t__.py", line 98, in <module>
_run()
File > "/Users/dariushmazlumi/Desktop/test/dist/test.app/Contents/Resources/__boo> t__.py", line 82, in _run
exec(compile(source, path, 'exec'), globals(), globals())
File > "/Users/dariushmazlumi/Desktop/test/dist/test.app/Contents/Resources/test.> py", line 1, in <module>
import tkinter
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in > _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
File "<frozen importlib._bootstrap>", line 616, in_load_backward_compatible
File "tkinter/__init__.pyc", line 36, in <module>
ValueError: character U+6573552f is not in range [U+0000; U+10ffff]
2017-09-06 14:08:17.090 test[1999:115511] test Error
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...99 completed.
[Process completed]
我正在使用macOS sierra 10.12。
答案 0 :(得分:1)
哇!我在这里搜索了py2app错误,有人有同样的问题! here。降级到py2app 0.12修复了我的错误。(可能py2app是0.14)。谢谢大家如何帮助我。