title: Why do I get a TypeError: 'module' object is not callable when trying to import the random module?
body: <p>I am using Python 2.6 and am trying to run a simple random number generator program (random.py):</p>
  
  <pre><code>import random
  
  for i in range(5):
  
      # random float: 0.0 &lt;= number &lt; 1.0
      print random.random(),
  
      # random float: 10 &lt;= number &lt; 20
      print random.uniform(10, 20),
  
      # random integer: 100 &lt;= number &lt;= 1000
      print random.randint(100, 1000),
  
      # random integer: even numbers in 100 &lt;= number &lt; 1000
      print random.randrange(100, 1000, 2)
  </code></pre>
  
  <p>I'm now receiving the following error:</p>
  
  <pre><code>C:\Users\Developer\Documents\PythonDemo&gt;python random.py
  Traceback (most recent call last):
    File "random.py", line 3, in &lt;module&gt;
      import random
    File "C:\Users\Developer\Documents\PythonDemo\random.py", line 8, in &lt;module&gt;
      print random.random(),
  TypeError: 'module' object is not callable
  
  C:\Users\Developer\Documents\PythonDemo&gt;
  </code></pre>
  
  <p>I've looked at the Python docs and this version of Python supports random.  Is there something else I'm missing?</p>