Python won't run due to ImportError: cannot import MAXREPEAT
Question: I am new to python but have been using both IDLE and EricIDE for a few weeks
without any major problems.

I was editing a program I had written that called `random.randint()` function
and it wouldn't work.  
Previously, this program had been working and I had not changed that call out.  
I then loaded another program that uses the same function that had been
working and it would not run either.  
I tried to load the program in IDLE but IDLE wouldn't load. After trying
several reboots and reloads EricIDE wouldn't load either. I noticed a black
window popping up and disappearing quickly when I try to launch either IDE
from my previously working desktop shortcuts.  
Searching for help led me to run python shell from the windows command line by
going to `C:\python33\ and typing "python" to run python shell`, I get:

    
    
    File "C:\python33\lib\sre_constants.py", line 18, in (module)
    
    from _sre import MAXREPEAT
    
    ImportError: cannot import name MAXREPEAT
    

I am using Windows 8 (new to it as well and still trying to figure it out).

At this point I'm assuming my problem is with my python installation since the
python shell won't work. I have uninstalled and reinstalled Python 3.3.1 but
the problem persists. I also deleted the .idlerc folder from my Users
directory as suggested in another thread that was similar to my problem but
that doesn't seem to have helped either.

Thank you for any help you can provide.

* * *

response to eryksun:

    
    
    C:\Python33>python.exe -c "import sys; print(sys.path)"
    Traceback (most recent call last):
      File "C:\Python33\lib\site.py", line 70, in <module>
        import re
      File "C:\Python33\lib\re.py", line 122, in <module>
        import sre_compile
      File "C:\Python33\lib\sre_compile.py", line 14, in <module>
        import sre_parse
      File "C:\Python33\lib\sre_parse.py", line 17, in <module>
        from sre_constants import *
      File "C:\Python33\lib\sre_constants.py", line 18, in <module>
        from _sre import MAXREPEAT
    ImportError: cannot import name MAXREPEAT
    
    C:\Python33>python.exe -S -c "import sys; print(sys.path)"
    ['', 'C:\\Python33\\python33.zip', 'C:\\Python33\\DLLs', 
     'C:\\Python33\\lib', 'C:\\Python33']
    

Follow up to to eryksun:

    
    
    C:\Python33>python.exe -S -c "import _imp; _sre = _imp.init_builtin('_sre'); 
    print(_sre.MAXREPEAT)"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'MAXREPEAT'
    


Answer: I suggest you uninstall. Completely remove `C:\Python33` and also
`C:\Windows\System32\python33.dll`. `_sre` is built in to the latter DLL.
`MAXREPEAT` is set by its initialization
function[`PyInit__sre`](http://hg.python.org/cpython/file/d9893d13c628/Modules/_sre.c#l3950)
(Modules/_sre.c). Clearly, something is wrong there.

When you download the 3.3.1 installer, make sure you get the right binary for
your platform, i.e. x86 for 32-bit Windows and X86-64 for 64-bit Windows.

