Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
“RuntimeError: This event loop is already running”; debugging aiohttp, asyncio and IDE “spyder3” in python 3.6.5 #7096
What steps reproduce the problem?
1. Run the following code in Spyder IDE
2. Run the code from above with cmd.exe
3. The above results match what I expect.
What is the expected output? What do you see instead?
Paste Traceback/Error Below (if applicable)
runfile('C:/Playground/Github/tradey/app/test_fast_web_00002.py', wdir='C:/Playground/Github/tradey/app') Traceback (most recent call last): File "<ipython-input-2-437c9e79feb0>", line 1, in <module> runfile('C:/Playground/Github/tradey/app/test_fast_web_00002.py', wdir='C:/Playground/Github/tradey/app') File "c:\playground\python\python36-32\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile execfile(filename, namespace) File "c:\playground\python\python36-32\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Playground/Github/tradey/app/test_fast_web_00002.py", line 23, in <module> loop.run_until_complete(main()) File "c:\playground\python\python36-32\lib\asyncio\base_events.py", line 455, in run_until_complete self.run_forever() File "c:\playground\python\python36-32\lib\asyncio\base_events.py", line 409, in run_forever raise RuntimeError('This event loop is already running') RuntimeError: This event loop is already running
Hmm. It worked with IPython 5.3.0 just fine.
Disregard the comment about spawning python processes. It appears this is a feature of code-completion features in the Editor (as per your own answer on StackOverflow I just came across).
Neverthless, why would it work with a previous version?
This worked for me "Can't invoke asyncio event_loop after tornado 5.0 update". Idk why, maybe just lucky.
Hi Lucas, If you're using asynchronous functionality, I would suggest using another IDE. I have switched to Pycharm and have had no issues since. You will not currently be able to use Spyder with asynchronous functions. Ryan…
On Tue, Aug 28, 2018, 5:56 PM lucasgriff88 ***@***.***> wrote: I am trying to learn how to use asyncio for asynchronous data acquisition. I found some example code from a tutorial: [image: 180828_spyder_error] <https://user-images.githubusercontent.com/17008269/44734788-59103300-aab0-11e8-8239-985ef31a0780.PNG> I found that loop.close() did not ever run. A print command after loop.run_until_complete did not print. Lastly loop.stop() results in "Kernel died, restarting" — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#7096 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AIopJUw28cmIo_5jyvW6Ga5cmohEMHalks5uVWgYgaJpZM4T5Eo-> .