1

I got this error when i try to import the discord module i installed it with pip install discord i am using pip version 10.0.1 and python 3.7

import discord File "C:\Users\chino\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\__init__.py", line 20, in <module> from .client import Client, AppInfo, ChannelPermissions File "C:\Users\chino\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\client.py", line 38, in <module> from .state import ConnectionState File "C:\Users\chino\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\state.py", line 36, in <module> from . import utils, compat File "C:\Users\chino\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\compat.py", line 32 create_task = asyncio.async ^ SyntaxError: invalid syntax

Patrick Haugh
  • 59,226
  • 13
  • 88
  • 96
Chin_077
  • 23
  • 3

1 Answers1

1

Discord.py is not compatible with Python 3.7 as stated on their github. They commited a fix but it's not published yet, so you can either downgrade to Python 3.6 or manually change the files as this commit:

https://github.com/Rapptz/discord.py/commit/096584733e8a8025b13f46fa920e18abe19352c1

Alternatively, if you really need python 3.7, you can use their updated rewrite branch, as they recommend, which has this fix already available.

Edit: Discord.py now supports python 3.7, so this should no longer be a problem.

Rodolfo Donã Hosp
  • 1,037
  • 1
  • 11
  • 23