Reputation: 389
I had installed a module with the command pip install google
. It worked file but when I try to run files with this module it gives error.
My code:-
from google import search
ip=raw_input("What would you like to search for? ")
for url in search(ip, stop=20):
print(url)
I have already installed google.
What am I doing wrong here?
Notes:-
python -m pip install google
it doesn't work.
Thank you!
Upvotes: 1
Views: 707
Reputation: 389
Yes I found myself the solution. Thanks to @user42 for the link. I used this command and it worked.
pip install --upgrade google-api-python-client
I have put the answer because it may help people who are facing or will be facing the same problem.
Upvotes: 1
Reputation: 36430
If you have more than 1 python installed, there is chance pip installed google in different python. To make sure it does install module for python you are using do:
python -m pip install google
Then try running your code again. If you want to know more about install
ing you might read Installing Python Modules.
Upvotes: 4