Closed kelmouloudi closed 4 years ago
Hey @kelmouloudi thanks for reporting, but it’s not a bug. Actually I explicitly ignored previous versions of python while migrating the code base from python 2.7 to 3.7 Check the compatibility here So in the meanwhile, you can upgrade your python version to 3.7 or greater. Otherwise let me know if this doesn’t solve your problem.
Thank you very much, sorry I didn't see the compatibility info.
@kelmouloudi no problem!
Sorry to reopen the issue. Now it gives me (I'm on python 3.7) :
`runfile('C:/Users/User/Documents/Mail Chimp/Communiqué de presse/email-validator.py', wdir='C:/Users/User/Documents/Mail Chimp/Communiqué de presse', post_mortem=True) Traceback (most recent call last):
File "
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/User/Documents/Mail Chimp/Communiqué de presse/email-validator.py", line 10, in
File "C:\ProgramData\Anaconda3\lib\site-packages\verify_email\verify_email.py", line 86, in verify_email resp = asyncio.run(_verify_email(email, timeout, verify, debug))
File "C:\ProgramData\Anaconda3\lib\asyncio\runners.py", line 34, in run "asyncio.run() cannot be called from a running event loop")
RuntimeError: asyncio.run() cannot be called from a running event loop`
hey @kelmouloudi, I don't see any problem using python 3.7
verify_email git:(master) ✗ python
Python 3.7.3 (default, Mar 27 2019, 09:23:15)
[Clang 10.0.1 (clang-1001.0.46.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from verify_email import verify_email
>>> verify_email('foo@gmail.com')
False
Can you tell me how exactly are you running this?
Try running python examples.py
from this repo.
I noticed you're using anaconda which might be running its own async runner (C:\ProgramData\Anaconda3\lib\asyncio\runners.py
) and hence there is already an event loop in your case.
Hello @kakshay21,
I have the same error: RuntimeError: asyncio.run() cannot be called from a running event loop
Does this mean that it's not possible to call verify_email() using Anaconda?
Hey @kelmouloudi , @thomaschheang can you try the fix and see if it works in your local?
branch: akshay-fix-event-loop
closing the issues as it should work now. @kelmouloudi @thomaschheang
Hi,
I use Python 3.6.7 |Anaconda custom (64-bit)| (default, Dec 10 2018, 20:35:02) [MSC v.1915 64 bit (AMD64)] on win32
and I'm trying to use verify_email like this :
But I get this error instead :