Forums

importerror with google search engine

What I am trying is a google search from a custom page and result shown back on page. For reference I am using

google search

Error I get is

2024-03-26 06:08:04,805: File "/home/giftopia/giftopia/app/views.py", line 5, in <module> 2024-03-26 06:08:04,805: from google.searchengine.web_search import google 2024-03-26 06:12:07,325: Error running WSGI application 2024-03-26 06:12:07,329: ModuleNotFoundError: No module named 'google.searchengine'

This error implies module is not present when I have installed it. In fact, just to make sure it works i have installed any other possible module that sounds like will work. pip freeze output is.

What is the correct method of installation. ?

(.myvirtualenv) 06:24 ~/giftopia $ pip freeze
asgiref==3.7.2
backports.zoneinfo==0.2.1
beautifulsoup4==4.12.3
cachetools==5.3.3
certifi==2024.2.2
charset-normalizer==3.3.2
Django==4.2.7

django-googlesearch==0.2
google==3.0.0
google-api-core==2.18.0
google-api-python-client==2.123.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
google-cloud==0.34.0
googleapis-common-protos==1.63.0
googlesearch-python==1.2.3

httplib2==0.22.0
idna==3.6
proto-plus==1.23.0
protobuf==4.25.3
pyasn1==0.5.1
pyasn1-modules==0.3.0
PyMySQL==1.1.0
pyparsing==3.1.2
requests==2.31.0
rsa==4.9
soupsieve==2.5
sqlparse==0.4.4
typing_extensions==4.8.0
uritemplate==4.1.1
urllib3==2.2.1

Make sure you're web app is running in the same virtual environment you installed the packages for; also it may an issue related to the package version, so check the docs if the api hasn't changed.