Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_task = asyncio.async: SyntaxError: invalid syntax #1396

Closed
alexwilkerson opened this issue Jul 5, 2018 · 6 comments
Closed

create_task = asyncio.async: SyntaxError: invalid syntax #1396

alexwilkerson opened this issue Jul 5, 2018 · 6 comments

Comments

@alexwilkerson
Copy link

Getting this error after updating Python to 3.7.0

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    import discord
  File "/Users/alex/code/leader-bot/venv/lib/python3.7/site-packages/discord/__init__.py", line 20, in <module>
    from .client import Client, AppInfo, ChannelPermissions
  File "/Users/alex/code/leader-bot/venv/lib/python3.7/site-packages/discord/client.py", line 38, in <module>
    from .state import ConnectionState
  File "/Users/alex/code/leader-bot/venv/lib/python3.7/site-packages/discord/state.py", line 36, in <module>
    from . import utils, compat
  File "/Users/alex/code/leader-bot/venv/lib/python3.7/site-packages/discord/compat.py", line 32
    create_task = asyncio.async
                              ^
SyntaxError: invalid syntax
@crrapi
Copy link
Contributor

crrapi commented Jul 5, 2018

Discord.py async does not work at all on 3.7, please downgrade to 3.6.X
Rewrite somewhat works but you should just stick to 3.6

@mrc0mmand
Copy link

Duplicate of #1249 and #1393.

@alexwilkerson
Copy link
Author

Thank you.

@ErMSDandyan
Copy link

from version 3.4
asycn and await are reserved keywords

like the error in below image

enter image description here

copy the link up to directory/folder name( not include init.py)
you will get a list of .py files
enter image description here

rename async file to _async or asynch or anything u want as async is now a reserved keyword with us from version 3.4

once renamed than open check in all files where we have import async
modify the new name every where

and enjoy

@scarletcafe
Copy link
Contributor

@ErMSDandyan async and await are only reserved in 3.7 onwards. Renaming library files or folders is not a good idea as it both creates inconsistency in your install and may confuse pip or setuptools if you decide to upgrade those libraries.

It also doesn't help for this issue, where asyncio.async is used. Modifying asyncio in this way will damage your install and prevent discord.py, or really any async library, from operating correctly.

Use an older version or use the rewrite branch to fix these issues.

@ErMSDandyan
Copy link

ErMSDandyan commented Aug 20, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants