Arya
Arya

Reputation: 389

Module not found even if it is in pip

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.

The image of 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.

enter image description here

What am I doing wrong here?

Notes:-

  1. I have only 1 python installed (Python 3.9.5)
  2. Even after using command python -m pip install google it doesn't work. Image- Module not found

Thank you!

Upvotes: 1

Views: 707

Answers (2)

Arya
Arya

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

Daweo
Daweo

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 installing you might read Installing Python Modules.

Upvotes: 4

Related Questions