Cannot import name search
See original GitHub issueI’ve installed google via pip for both python2 (system distro) and anaconda for python3. I’m using ubuntu 16.04. When I try to import anything, like search, it says
ImportError: cannot import name 'search'
That’s after doing
from google import search
The same thing happens in python2 or 3.
When I import google and check the ‘dir’, it says: (python3)
In [84]: dir(google)
Out[84]: ['__doc__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
(python2)
In [3]: dir(google)
Out[3]: ['__doc__', '__name__', '__path__']
Any ideas what’s going on? The __init__.py file looks fine where it’s installed, which I found from google.__path__. But I thought for most packages, .__file__ was the way to specify the filepath to the module.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:12 (6 by maintainers)
Top Results From Across the Web
python - ImportError: cannot import name 'search' from 'google ...
I would install googlesearch using python3 -m pip install googlesearch-python. Then the function is simple to call. from googlesearch import ...
Read more >How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >How to Fix : “ImportError: Cannot import name X” in Python
In Python "ImportError: cannot import name" error generally occurs when the imported class is not accessible, or the imported class is in a...
Read more >Cannot import name 'search' from 'google_search' - Replit
The line that I used to do it was: 'from googlesearch import search' I had tried running the same code on pycharm and...
Read more >ImportError: cannot import name X in Python [Solved]
The Python "ImportError: cannot import name" often occurs when we have circular imports (importing members between the same files).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

ImportError: cannot import name ‘search’ from ‘googlesearch’
AttributeError: module ‘googlesearch’ has no attribute ‘search’
This is not working on google colab apparently.