pygooglenews
pygooglenews copied to clipboard
ImportError: cannot import name 'GoogleNews' from partially initialized module 'pygooglenews'
Hello, I'm having problem with running pygooglenews. My error result as follows:
Traceback (most recent call last):
File "C:\pygooglenews.py", line 1, in
ImportError: cannot import name 'GoogleNews' from partially initialized module 'pygooglenews' (most likely due to a circular import) (C:\pygooglenews.py)
Here's my code :
from pygooglenews import GoogleNews gn = GoogleNews() search = gn.search('lockdown') print(search)
Be careful when naming the filenames - Python takes them into account too.
pygooglenews.py
has the exact same name with the module you're trying to import the class from. (pygooglenews
), this confuses the interpreter, which makes it import GoogleNews
from your file.
It is recommended that you rename pygooglenews.py
to something like app.py
to avoid future problems.