ImportError: cannot import name BaseHTTPRequestHandler
<p>I try to run first example from <a href="http://wiki.python.org/moin/BaseHttpServer" rel="nofollow">python wiki</a> and when I try to run it:</p>

<pre><code>$ python BaseHttpServer.py
</code></pre>

<p>I get an error <strong>AttributeError: 'module' object has no attribute 'BaseHTTPRequestHandler'</strong>.</p>

<p>I tested it on Python 2.7.3 on Linux Mageia 2 64-bit:</p>

<pre><code>Traceback (most recent call last):
  File "BaseHTTPServer.py", line 9, in &lt;module&gt;
    import BaseHTTPServer
  File "/home/vanveber/BaseHttpServer/BaseHTTPServer.py", line 14, in &lt;module&gt;
    class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
AttributeError: 'module' object has no attribute 'BaseHTTPRequestHandler'
</code></pre>

<p>And it on Python 2.7.3 on Windows 7 64-bit</p>

<pre><code>Traceback (most recent call last):
  File "BaseHTTPServer.py", line 11, in &lt;module&gt;
    from BaseHTTPServer import BaseHTTPRequestHandler
  File "C:\BaseHttpServer\BaseHTTPServer.py", line 11, in &lt;module&gt;
    from BaseHTTPServer import BaseHTTPRequestHandler
ImportError: cannot import name BaseHTTPRequestHandler
</code></pre>

<p><strong>BUT!</strong></p>

<ol>
<li>BaseHttpServer is a class from <strong>standard Python library</strong>. </li>
<li>If I write and run this code from <strong>Python GUI on Windows</strong> it works correctly!</li>
</ol>

<p>What is a problem and why?!</p>
