RandomWords Module Not Working


#1

I am trying to use the RandomWords module
https://pypi.python.org/pypi/RandomWords/0.1.5

I can see that it was installed, but if I try to import it, I get this message.
ImportError: No module named RandomWords

I’m sure i’m missing something, and I am hoping someone can help me out.
Thanks in advance.


#2

Would be better if you can share us your Python code where you import the module.


#3

This is the command I used to install the package.
pip install --user RandomWords

Here is the code.
import RandomWords
rw = RandomWords()
word = rw.random_word()
print(word)

The code is directly from the package page.

Thanks again.


#4

The first line should be from random_words import RandomWords

It imports the module (which is named random_words) and assigns it to the variable RandomWords


#5

Thanks for all of the help.
Timjrobinson was correct with the import. It also will not work with Python3.