Skip to content Skip to sidebar Skip to footer

Python - 'module' Object Has No Attribute 'randrange'

I've 2 files a.py and b.py a.py from b import * #and then some lines of code b.py import random red = random.randrange(1,257) / 256.0 #and then some lines of code While running

Solution 1:

You've a third file, random.py. Rename it.

Solution 2:

To confirm @ignacio 's answer you can run python -v <script>

This will list down all the importing modules and from where they are imported.

Post a Comment for "Python - 'module' Object Has No Attribute 'randrange'"