I get an error `Invalid Syntax`



i am having a problem with c9. I am creating a bot for a service using Python. The code works fine on my computer, but when I try to use it on c9, I get the following error:

File "bot.py", line 7
async def on_ready():
SyntaxError: invalid syntax

Why is that? Please help.
Thanks in advance


What version of python are you using locally? You may need to update python on c9.


If your bot is written in Python 3, try running it with python3 command instead.


I have tried both - same error


It’s tough to tell what the issue is with the information you’ve given. Can you include some of your code so we can see what might be going on? If your workspace is public you could include a link to the workspace as well.


I’m getting this same error. The problem is defining asynchronous functions in python 3.6. The code that is causing this problem for both of us is:

async def on_ready():
print(‘Logged in as’)

This code is for the on_ready event for a discord python bot. If I remove this function, I get the same error on my next function.