-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot import name search #39
Comments
Maybe try again with python3-pip? I'm using pip for Python 3 and have no problems. |
I cannot reproduce the problem...
Perhaps you have another module with the same name? |
Ah, I get it now, this other ticket describes the problem: #36 |
Changed the name of the package to "googlesearch" to avoid the name collision. Also updated the version number since this would break existing scripts. |
how can i do this ? |
Change "from google import search" To from googlesearch import search |
ImportError: cannot import name 'search' from 'googlesearch' |
You'll have to give me more that that because I've no idea what you have
installed or how in your computer.
…On Sun, Sep 29, 2019 at 11:46 PM ThePyProgrammer ***@***.***> wrote:
ImportError: cannot import name 'search' from 'googlesearch'
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#39?email_source=notifications&email_token=AABXUU5XQIYU4UGIKNBBZ2LQMDEV5A5CNFSM4DZQVX4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73YEKI#issuecomment-536314409>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABXUU5ACZGCJTVZ7NEZD2DQMDEV5ANCNFSM4DZQVX4A>
.
--
“There's a reason we separate military and the police: one fights the enemy
of the state, the other serves and protects the people. When the military
becomes both, then the enemies of the state tend to become the people.”
|
AttributeError: module 'googlesearch' has no attribute 'search' This is not working on google colab apparently. |
Thank you for your valuable time. I think it was the issue of the name collision. There were different modules I had installed for google-search. So I uninstalled all of them and then reinstalled "pip install google" only and then it worked. |
Glad to be of help! :) |
Had the exact same issue, changed to a new clean venv and it worked |
I'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)
(python2)
Any ideas what's going on? The
__init__.py
file looks fine where it's installed, which I found fromgoogle.__path__
. But I thought for most packages,.__file__
was the way to specify the filepath to the module.The text was updated successfully, but these errors were encountered: