Error in random module, bad installation?

Carsten Haese carsten at uniqsys.com
Wed Sep 12 18:56:28 EDT 2007


On Wed, 2007-09-12 at 15:13 -0700, Andrew F wrote:
> >>> import random
> Unexpected error: <type 'exceptions.TypeError'>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "random.py", line 10, in <module>
>     x = random.random()
> TypeError: 'module' object is not callable

You have a file called random.py in your current directory. It's
shadowing the random module from the library.

HTH,

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list