verify_email icon indicating copy to clipboard operation
verify_email copied to clipboard

There is no current event loop in thread 'Thread-2'.

Open Muhammedsuwaneh opened this issue 4 years ago • 4 comments

There is no current event loop in thread 'Thread-2'. I am getting this error whenever I try to verify an email in django

Muhammedsuwaneh avatar Feb 14 '21 23:02 Muhammedsuwaneh

Hi @Muhammedsuwaneh, thanks for reporting! Can you also send the stack trace? With environment configuration like python version, django version?

kakshay21 avatar Feb 15 '21 08:02 kakshay21

Hey I am also getting the same error on django, is there any workaround? python version 3.9 django version 3.1.7

harishsg99 avatar May 08 '21 07:05 harishsg99

I haven't figured out a solution yet.

On Sat, May 8, 2021 at 12:39 AM Harish S.G @.***> wrote:

Hey I am also getting the same error on django, is there any workaround?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kakshay21/verify_email/issues/41#issuecomment-835178016, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLYLH5BOJGB4Q7ZEE4ZAD3TMTTCRANCNFSM4XTWRFLA .

Muhammedsuwaneh avatar May 08 '21 09:05 Muhammedsuwaneh

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

this problem is not related to verify_email package are you using a web server like Django and Flask so you should be register loop event like this

import asyncio
 asyncio.set_event_loop(asyncio.new_event_loop())
           for row in data.itertuples():
          
            try:
                print(row.Email)
                emails.append(row.Email)
                verified_emails.append(verify_email(row.Email))
            except Exception as e:
                print(e)

it's work for me

afsar47 avatar Aug 20 '23 11:08 afsar47