LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Python: Idle: ImportError: cannot import name sleep (https://www.linuxquestions.org/questions/linux-newbie-8/python-idle-importerror-cannot-import-name-sleep-368479/)

Joe Soap 09-30-2005 10:26 AM

Python: Idle: ImportError: cannot import name sleep
 
G'day Folks,


I am running 2.6.11-Kanotix-11 and am experiencing a pretty weird error (to me...) with Python and Idle.

When I start Idle from my home directory it starts without any problem, however when I try to start it from ~/python I get the following output:

---------------------
e-dua@EGLOBE:~/python$ idle
23:59:30
22:59:30
0
22:59:35
0
1
1
1
Traceback (most recent call last):
File "<string>", line 1, in ?
File "/usr/lib/python2.3/idlelib/run.py", line 7, in ?
import threading
File "/usr/lib/python2.3/threading.py", line 12, in ?
from time import time as _time, sleep as _sleep
ImportError: cannot import name sleep
-----------------------
My python version 2.3.5. Idle version is 1.0.5.

Any ideas why this happens? What can I do to fix it?

All help appreciated.

Thanks,
Joe

Joe Soap 10-01-2005 01:52 AM

Found the answer.

I had a file time.py in my ~/python directory. I renamed it to time0.py and everything works again.


All times are GMT -5. The time now is 08:01 PM.