Puppy Linux上的Tkinter导入错误

时间:2015-07-17 11:00:31

标签: linux python-3.x tkinter

我在使用Geany编写和执行代码的Puppy Linux笔记本电脑上运行tkinter时遇到一些问题。我已经运行了Python 3.1,但每当我尝试

import tkinter

我收到以下错误消息:

file "/usr/lib/python3.1/tkinter/__init__.py", line 40, in <module>
import _tkinter

UnicodeEncodeError: 'latin-1 codec can't encode characters in position 0-3: ordinal not in range(256)

我没有最模糊的事情发生了什么!

我从:

更改了Geany filetypes.python文档
compiler=python -m py_compile "%f"
run_cmd=python "5f"

将Python2作为默认值(tkinter使用此导入很好!)运行到:

compiler=python3.1 -c "import py_compile;py_compile.compile('%f')"
run_cmd=python3.1 "%f"

为了允许我使用python 3.1作为默认值。我确实复制了这段代码,而不是写它,因为我不熟悉Linux。

我想知道如何在PuppyLinux上成功使用Python3的tkinter。我并不喜欢使用Geany,所以感谢任何帮助!

0 个答案:

没有答案