Python Forum
AttributeError: module 'asyncio' has no attribute 'get_event_loop
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AttributeError: module 'asyncio' has no attribute 'get_event_loop
#1
Hi all

I am trying to use Python asyncio module.
Adding my code snippet below :

import asyncio

async def speak_async():  
    print('OMG asynchronicity!')

loop = asyncio.get_event_loop()  
loop.run_until_complete(speak_async())  
loop.close() 


Am getting the following error while executing the script : "AttributeError: module 'asyncio' has no attribute 'get_event_loop'".
Am using Python 3.5.
Please share you valuable suggestion to solve the issue.


Regards
Susmitha
Reply
#2
I can't reproduce the error.
OS, Python version? More details, please
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
make sure your file (or another one in the same folder) is not named asyncio.py
Reply
#4
Hi Buran & wavic,

Thanks for your reply.
I named the file as asyncio.py ,i renamed the file and its working.

Thanks
Susmitha
Reply
#5
I always forget about this common mistake  Big Grin
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#6
(Apr-24-2017, 09:54 AM)buran Wrote: make sure your file (or another one in the same folder) is not named asyncio.py
thanks a lot
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  getpass.getpass() results in AttributeError: module 'os' has no attribute 'O_NOCTTY' EarthAndMoon 4 769 Oct-03-2023, 02:00 PM
Last Post: deanhystad
  AttributeError: '_tkinter.tkapp' object has no attribute 'username' Konstantin23 4 1,706 Aug-04-2023, 12:41 PM
Last Post: Konstantin23
  Parallel processing - AttributeError: Can't get attribute 'sktimekmeans' Mohana1983 1 756 Jun-22-2023, 02:33 AM
Last Post: woooee
  Python: AttributeError: 'PageObject' object has no attribute 'extract_images' Melcu54 2 3,898 Jun-18-2023, 07:47 PM
Last Post: Melcu54
  cx_oracle Error - AttributeError: 'function' object has no attribute 'cursor' birajdarmm 1 2,362 Apr-15-2023, 05:17 PM
Last Post: deanhystad
  Pandas AttributeError: 'DataFrame' object has no attribute 'concat' Sameer33 5 5,639 Feb-17-2023, 06:01 PM
Last Post: Sameer33
  AttributeError: 'numpy.ndarray' object has no attribute 'load' hobbyist 8 7,127 Jul-06-2022, 10:55 AM
Last Post: deanhystad
  AttributeError: 'numpy.int32' object has no attribute 'split' rf_kartal 6 4,398 Jun-24-2022, 08:37 AM
Last Post: Anushka00
  AttributeError: 'list' object has no attribute 'upper' Anldra12 4 4,884 Apr-27-2022, 09:27 AM
Last Post: Anldra12
  AttributeError: 'function' object has no attribute 'metadata 3lnyn0 5 4,618 Mar-28-2022, 04:42 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020