飞花落尽 发表于 2021-8-24 16:45:47

为什么无法导入tkinter?

>>> import tkinter
IDLE internal error in runcode()
Traceback (most recent call last):
File "C:\Users\Ljy\AppData\Local\Programs\Python\Python39\lib\idlelib\rpc.py", line 342, in putmessage
    r, w, x = select.select([], , [])
TypeError: argument must be an int, or have a fileno() method.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Ljy\AppData\Local\Programs\Python\Python39\lib\idlelib\rpc.py", line 243, in asyncqueue
    self.putmessage((seq, request))
File "C:\Users\Ljy\AppData\Local\Programs\Python\Python39\lib\idlelib\rpc.py", line 345, in putmessage
    raise OSError("socket no longer exists")
OSError: socket no longer exists
代码如上

白two 发表于 2021-8-24 16:45:48

可能是有文件和 python 关键字、内置函数、模块啥的重名了
你是不是装了两个版本的 python ?

叼辣条闯世界 发表于 2021-8-24 20:15:46

在C:\Users\Ljy\AppData\Local\Programs\Python\Python39\lib\idlelib\rpc.py里第342,345,143行有错误

飞花落尽 发表于 2021-8-25 09:40:00

白two 发表于 2021-8-24 16:45
可能是有文件和 python 关键字、内置函数、模块啥的重名了
你是不是装了两个版本的 python ?

厉害
页: [1]
查看完整版本: 为什么无法导入tkinter?