tags:

views:

43

answers:

1

Hi, I'm have problems opening IDLE - I can only get it 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.

+3  A: 

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

It's now fixed, and I'm off to die quietly in a hole somewhere.

Joe
Ah, jolly good then. Will you be needing my sword? :)
JoshD
Don't feel bad; I did something very similar a couple weeks ago and was going nuts trying to figure out why Python was giving me a threading error when I'd exit the interpreter, but only sometimes. The answer was I'd created a module called threading.py to play around with threads. The error occurred only when I started Python with the directory where I'd put that script as the current directory, where it would override the system threading module.
kindall