首先讓我給出一些導致問題的背景信息。 我的Win 8.1筆記本電腦中安裝了兩個版本的Python。最初Py 2.5被設置爲默認值。我的方式做了它是我改名的Python 3.5的python.exe
爲python35.exe
和文件 pythonw.exe
作爲pythonw35.exe
這似乎已經創建了兩個.dll
文件具有相同的名稱,這兩個文件(我不記得是否兩個dll文件出現在重命名之前)併成功將Python 2.7設置爲默認值(即,當我在命令行中輸入命令python
,python 2.7 ran時)。最近我需要將Python 3.5設置爲默認值。然後,我繼續以相同的方式重命名Python 2.7
版本的文件,並將3.5版本的文件名恢復爲其原始正常格式(即python.exe
和pythonw.exe
)。OSError:套接字不再存在(Python空閒錯誤)
這一切的混亂後,我跑在IDLE print("Hello World")
並跳起了以下錯誤:
IDLE internal error in runcode()
Traceback (most recent call last):
File "C:\Python35-32\lib\idlelib\rpc.py", line 339, in putmessage
r, w, x = select.select([], [self.sock], [])
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:\Python35-32\lib\idlelib\rpc.py", line 240, in asyncqueue
self.putmessage((seq, request))
File "C:\Python35-32\lib\idlelib\rpc.py", line 342, in putmessage
raise OSError("socket no longer exists")
OSError: socket no longer exists
這些DLL不是通過重命名可執行文件而創建的。爲所有用戶安裝時,Python 3.5不再在System32目錄中安裝python35.dll。它總是在python.exe旁邊。每臺計算機安裝現在默認爲「Program Files [(x86)]」,這是程序的首選和安全目錄。 – eryksun