verify_email icon indicating copy to clipboard operation
verify_email copied to clipboard

RuntimeError: This event loop is already running

Open speakingtechnology opened this issue 3 years ago • 2 comments

On trying to run the sample code provided, I am getting RuntimeError mentioning the loop to be running. Can anyone help?


RuntimeError Traceback (most recent call last) in 1 from verify_email import verify_email 2 ----> 3 verify_email('[email protected]') 4 5 #verify_email(['[email protected]', '[email protected]'])

F:\Anaconda3\lib\site-packages\verify_email\verify_email.py in verify_email(emails, timeout, verify, debug) 104 105 for email in emails: --> 106 resp = loop.run_until_complete(_verify_email(email, timeout, verify)) 107 result.append(resp) 108

F:\Anaconda3\lib\asyncio\base_events.py in run_until_complete(self, future) 568 future.add_done_callback(_run_until_complete_cb) 569 try: --> 570 self.run_forever() 571 except: 572 if new_task and future.done() and not future.cancelled():

F:\Anaconda3\lib\asyncio\base_events.py in run_forever(self) 523 self._check_closed() 524 if self.is_running(): --> 525 raise RuntimeError('This event loop is already running') 526 if events._get_running_loop() is not None: 527 raise RuntimeError(

RuntimeError: This event loop is already running

speakingtechnology avatar Nov 15 '21 04:11 speakingtechnology

I was having that problem while using a Jupyter notebook.

I solved the problem by:

  • installing nest-asyncio: pip install nest-asyncio

  • running a code cell with:

import nest_asyncio
nest_asyncio.apply()

ricardocarvalhods avatar Mar 14 '22 01:03 ricardocarvalhods

Can you guys try the 2.4.4 version and see if it works? pip3 install verify-email==2.4.4.dev0

kakshay21 avatar Oct 03 '22 20:10 kakshay21

check: https://github.com/kakshay21/verify_email/issues/48#issuecomment-1685262024

kakshay21 avatar Sep 22 '23 13:09 kakshay21