this will help When you from random import *, all the definitions from random become part of the current name space. This means you don't have to prefix anything with random., but it also means you may get a name collision without even knowing it. The preferred way is import random.
I think the issue was by ths following , It is common practice to use a leading underscore for modules implemented in C. Often the pattern _mod for this C module and mod for a Python module that imports this _mod is used. You will find this for several modules of the standard library. Typically, you should use mod and not _mod. On Mac OS X there is a file:
>>> <module '_random' from '/path/to/python/sharedlibs/_random.so'>
I hope this helps you . The traceback is relatively clear: you attempt to import randint from random; inside the python random module it attempts to import names from math; unfortunately, you chose to name one of your own modules in the working directory math as well and so it finds that first; when importing your math, it attempts to import random ... now you have an circular import ... and it fails. Conclusion:
Generating distinct random numbers using import random python