1

Below is the snippet:

C:\APPS>python
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
>>> random.seed()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'seed'
>>> random.randint(0,3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'randint'
>>>
2
  • Do you have any other modules with name random? Commented Nov 26, 2013 at 6:06
  • I tried it, but didn't have any errors. Commented Nov 26, 2013 at 6:08

2 Answers 2

3

You probably have a file called random.py in the APPS directory. Delete or rename that file.

Sign up to request clarification or add additional context in comments.

Comments

2

Try something like this to see which random module you're using:

In [1]: import random

In [2]: print(random.__file__)
/usr/lib/python3.2/random.py

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.