import random error

Rob B mrbrown200425 at yahoo.com
Thu Aug 5 17:24:57 EDT 2004


Hello,

I am just starting to learn Python and was writing a simple script on
my machine (Mac OS X 10.3.4), but I can't seem to import the random
module:

#!/usr/bin/env python

import random

Results in:

Traceback (most recent call last):
  File "./math.py", line 3, in ?
    import random
  File "/sw/lib/python2.3/random.py", line 42, in ?
    from math import log as _log, exp as _exp, pi as _pi, e as _e
ImportError: cannot import name log

I have such a feeling that this is either a) because I don't know what
I'm doing or b) the python install is somehow strange. What is strange
is that in interactive mode, import random works fine.

Thanks in advance,

Rob



More information about the Python-list mailing list