Error in random module, bad installation?

Andrew F andrew.lee at nymag.com
Wed Sep 12 18:13:58 EDT 2007


I'm a linux user and I just upgraded from 2.1 to 2.5 and changed the
location of a number of libraries and tools.

So far I've tracked most errors, but this one has me scratching my
head :

$ which python
/usr/local/bin/python
$ echo $PYTHONPATH
/usr/local/bin/python
$ python
Python 2.5.1 (r251:54863, Sep  5 2007, 09:48:37)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 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
>>>

$ find /usr/local/ -name random.py
./lib/python2.5/random.py
./lib/python2.3/random.py

Do I need to clobber 2.3?  ( If so, why???)

TIA

-- Andrew




More information about the Python-list mailing list