problems loading modules

Frank supervau at gmail.com
Mon Feb 5 00:46:10 EST 2007


Hi,

I have the following weird behavior when I load modules:


>>> import random
>>> print random.randrange(10)
8
>>>

Everything is fine.

>>> import random
>>> from numpy import *
>>>
>>> print random.randrange(10)
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'randrange'
>>>

Here it does not work.


>>> from numpy import *
>>> import random
>>>
>>> print random.randrange(10)
8
>>>

Now everything is back to normal.

That means the order the modules are loaded matters! I would expect
there is a problem with my installation because I guess this should
normally be independent of the loaded modules.

Here are my questions:
1. Does anyone has this behavior too?

2. How can I fix this problem?

I use linux with fedora core 6 and python 2.4.4

I appreciate any hint. Thanks!

Frank




More information about the Python-list mailing list