Exception: AttributeError: module 'random' has no attribute


This works fine:


examples/my/random.py
print("Hello World")

This gives an error


examples/my/rnd.py
import random
print(random.random())

Traceback (most recent call last):
  File "rnd.py", line 2, in <module>
    print(random.random())
AttributeError: module 'random' has no attribute 'random'

Make sure the names of your files are not the same as the names of any of the python packages.