开发者

Python IDLE won't open

I'm have problems opening IDLE - I can only get i开发者_C百科t to open when I right click > edit with IDLE on a PY file. I'm running Python 2.6.4. I tried using 'python.exe Lib\idlelib\idle.py', and I get a few errors:

C:\Python26>python.exe Lib\idlelib\idle.py

----------------------------------------
Unhandled server exception!
Thread: SockThread
Client Address:  ('127.0.0.1', 8833)
Request:  <socket._socketobject object at 0x0248CD18>
Traceback (most recent call last):
  File "C:\Python26\lib\SocketServer.py", line 281, in _handle_request_noblock
    self.process_request(request, client_address)
  File "C:\Python26\lib\SocketServer.py", line 307, in process_request
    self.finish_request(request, client_address)
  File "C:\Python26\lib\SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python26\lib\idlelib\rpc.py", line 503, in __init__
    SocketServer.BaseRequestHandler.__init__(self, sock, addr, svr)
  File "C:\Python26\lib\SocketServer.py", line 615, in __init__
    self.handle()
  File "C:\Python26\lib\idlelib\run.py", line 256, in handle
    import IOBinding
  File "C:\Python26\lib\idlelib\IOBinding.py", line 12, in <module>
    import tempfile
  File "C:\Python26\lib\tempfile.py", line 34, in <module>
    from random import Random as _Random
ImportError: cannot import name Random

*** Unrecoverable, server exiting!
----------------------------------------
Traceback (most recent call last):
  File "Lib\idlelib\idle.py", line 21, in <module>
    idlelib.PyShell.main()
  File "C:\Python26\lib\idlelib\PyShell.py", line 1400, in main
    shell = flist.open_shell()
  File "C:\Python26\lib\idlelib\PyShell.py", line 281, in open_shell
    if not self.pyshell.begin():
  File "C:\Python26\lib\idlelib\PyShell.py", line 989, in begin
    client = self.interp.start_subprocess()
  File "C:\Python26\lib\idlelib\PyShell.py", line 404, in start_subprocess
    self.transfer_path()
  File "C:\Python26\lib\idlelib\PyShell.py", line 486, in transfer_path
    \n""" % (sys.path,))
  File "C:\Python26\lib\idlelib\PyShell.py", line 696, in runcommand
    self.rpcclt.remotequeue("exec", "runcode", (code,), {})
  File "C:\Python26\lib\idlelib\rpc.py", line 216, in remotequeue
    return self.asyncreturn(seq)
  File "C:\Python26\lib\idlelib\rpc.py", line 240, in asyncreturn
    response = self.getresponse(seq, wait=0.05)
  File "C:\Python26\lib\idlelib\rpc.py", line 280, in getresponse
    response = self._getresponse(myseq, wait)
  File "C:\Python26\lib\idlelib\rpc.py", line 300, in _getresponse
    response = self.pollresponse(myseq, wait)
  File "C:\Python26\lib\idlelib\rpc.py", line 428, in pollresponse
    self.handle_EOF()
  File "C:\Python26\lib\idlelib\PyShell.py", line 334, in handle_EOF
    raise EOFError
EOFError

C:\Python26>

Any help is greatly appreciated.


PEBKAC: I had foolishly created a file named random.py and placed it in the Python26 directory.

It's now fixed, Thanks.


I know this question was posted a long time ago but I came across a good source, which could help to answer for anyone with similar problems: https://community.activestate.com/node/12746

It basically requires copy and past the tl and tk folders to the lib folder in Python.

Hope it helps,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜