Python won't run

dkiekow at gmail.com dkiekow at gmail.com
Mon Mar 2 04:52:16 CET 2009


On Feb 23, 5:01 pm, Ned Deily <n... at acm.org> wrote:
> [Again, please reply-all to the list, don't send private email!]
>
> On Feb 23, 2009, at 14:03 , kevin hayes wrote:
>
>
>
> > Ned, system log didn't do anything when I tried to open IDLE. However, this
> > is what's in the console.log. does this tell you anything?
>
> > Unhandled server exception!
> > Thread: SockThread
> > Client Address:  ('127.0.0.1', 8833)
> > Request:  <socket._socketobject object at 0x1087bc8>
> > Traceback (most recent call last):
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServ er.
> > py", line 281, in _handle_request_noblock
> >     self.process_request(request, client_address)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServ er.
> > py", line 307, in process_request
> >     self.finish_request(request, client_address)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServ er.
> > py", line 320, in finish_request
> >     self.RequestHandlerClass(request, client_address, self)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/rp c.p
> > y", line 503, in __init__
> >     SocketServer.BaseRequestHandler.__init__(self, sock, addr, svr)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServ er.
> > py", line 615, in __init__
> >     self.handle()
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/ru n.p
> > y", line 256, in handle
> >     import IOBinding
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/IO Bin
> > ding.py", line 12, in <module>
> >     import tempfile
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tempfile.p y",
> >  line 34, in <module>
> >     from random import Random as _Random
> >   File "random.py", line 3, in <module>
> >     import rand      # handy random-number functions
> > ImportError: No module named rand
>
> > *** Unrecoverable, server exiting!
>
> [...]
>
> It looks like you have a file named random.py in your Documents
> directory.  IDLE.app adds ~/Documents to the front of sys.path, python's
> search path for modules.   Your random.py is being found before the
> standard library module, random, causing the idle server process to
> abort.  Rename your random.py* and all should be well for both 2.5 and
> 2.6.
>
> One could argue that IDLE.app should be smarter about situations like
> this.  It would be good to open an issue about this on the python
> tracker:
>    http://bugs.python.org/
>
> --
>   Ned Deily
>   n... at acm.org -- []
>
> --
>  Ned Deily,
>  n... at acm.org

I just downloaded the os x installer (2.5) and followed the
instructions in the wiki to install IDLE. When I double click the icon
it bounces, but nothing happens. From the command line python -m
idlelib.idle -n brings up a python terminal window. I tried searching
for random.py and did not find it. System I'm using is 10.5.6 on a
MacPro.



More information about the Python-list mailing list