Installing "Random" Module Problem



Hello, apologies if this is a noob question.

I want to install the “random” module in my python environment. I use “sudo easy_install random” and it says it cannot find it in I looked and it looks like random is not there. My understanding is “random” is a popular module and I am confused as to why it is not on pypi. Is there another way to install it in my environment? Thank you!

Below is my Bash:

/workspace/.c9 $ sudo easy_install random
Searching for random
Couldn’t find index page for ‘random’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
No local packages or download links found for random
error: Could not find suitable distribution for Requirement.parse(‘random’)


i think it’s a built-in module, try

>>> import random
>>> random.random()


Thank you very much for taking the time to answer my question! It is really appreciated. If you still have time to help, I still get an error though when I input the import random and random.random() as you wrote in your code.

When I put in and run:
import random

I get the Bash message:

Traceback (most recent call last):
File “”, line 1, in
import random
File “/home/ubuntu/workspace/”, line 2, in
TypeError: ‘module’ object is not callable

All attempts to Google this problem usually bring up more complicated issues. I must be missing something very basic?

Again, thank you for your time in helping to answer my questions.


It seems that If you call your file random, you can’t import the global random anymore. Rename it, and make sure to delete the random.pyc file.