Skip to content
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

RuntimeError: There is no current event loop in thread 'MainThread'. #152

Closed
andreacortis opened this issue Dec 2, 2021 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@andreacortis
Copy link

andreacortis commented Dec 2, 2021

Describe the bug
RuntimeError: There is no current event loop in thread 'MainThread'.

To Reproduce
UBUNTU 20.04 -- pipenv

╰─(googlebooks-rNF90ExY) ⠠⠵ ipython
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.30.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from search_engine_parser.core.engines.google import Search
...: searcher = Search()
...: results = searcher.search("Tallest mountain in the world")

RuntimeError Traceback (most recent call last)
in
1 from search_engine_parser.core.engines.google import Search
2 searcher = Search()
----> 3 results = searcher.search("Tallest mountain in the world")

~/.local/share/virtualenvs/googlebooks-rNF90ExY/lib/python3.8/site-packages/search_engine_parser/core/base.py in search(self, query, page, cache, proxy, proxy_auth, **kwargs)
279 page = 1
280 # Get search Page Results
--> 281 loop = asyncio.get_event_loop()
282 url = self.get_search_url(
283 query, page, **kwargs)

/usr/lib/python3.8/asyncio/events.py in get_event_loop(self)
637
638 if self._local._loop is None:
--> 639 raise RuntimeError('There is no current event loop in thread %r.'
640 % threading.current_thread().name)
641

RuntimeError: There is no current event loop in thread 'MainThread'.

@andreacortis andreacortis added the bug Something isn't working label Dec 2, 2021
@deven96 deven96 closed this as completed Jul 16, 2022
@judemont
Copy link

I have the same issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants