Google-Search-API icon indicating copy to clipboard operation
Google-Search-API copied to clipboard

ImportError

Open sayamkanwar opened this issue 7 years ago • 3 comments

Hi, I just ran a simple script: from google import google num_page = 3 search_results = google.search("Hello World", num_page)

It is giving an error even though I have installed the library through pip. Error: File "", line 1, in File "google.py", line 1, in from google import google ImportError: cannot import name google

What should I do to correct it?

sayamkanwar avatar Feb 24 '18 01:02 sayamkanwar

@abenassi I did this, I get this error

>>> import imp
>>> google = imp.load_source('google', '/home/arjun/.local/lib/python2.7/site-packages/google/__init__.py')
>>> num_page = 3
>>> search_results = google.search("This is my query", num_page)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'search'
>>> google
<module 'google' from '/home/arjun/.local/lib/python2.7/site-packages/google/__init__.pyc'>

arjunmenon avatar Mar 10 '18 15:03 arjunmenon

Related question on stackoverflow.

lukruh avatar Mar 10 '18 16:03 lukruh

Likely related https://github.com/abenassi/Google-Search-API/issues/40

karlicoss avatar Nov 10 '18 10:11 karlicoss