Closed galac-tech closed 8 years ago
In python 3.5 you're supposed to be using
async def function_name(arguments):
await function()
Not
@asyncio.coroutine
def function_name(arguments):
yield from function()
Btw, reinstall discord.py
The problem here is most likely with your Python install. Reinstalling 3.5 should solve this.
Or you have a module in your bot's directory named asyncio.py
.
@GetRektByMe I saw that and I tried to go through the package and change all the instances of @asyncio.coroutine to async def... along with all the yield from's to await but I started to get an error that await and async were being used improperly or something... Also I removed discord.py and reinstalled it twice after getting Python 3.5.2, didn't help :(
@mikevb1 I had Python 3.5.1, which I updated to 3.5.2 about 30 minutes before I made this post, but it made no difference.
Should I try to use an older version of Python that is compatible with @asyncio.coroutine?
Thanks for the help!
Python is forwards compatible, 3.4's @asyncio.coroutine
should work... You've messed up your python install somehow unless you have a file called asyncio.py in your project. Send a screenshot of your project structure
Your python install is borked. Don't modify the library files.
@GetRektByMe So I found a __pycache__
folder and deleted it. Now I'm not getting that long error log but I do get this :
async def on_ready():
^
SyntaxError: invalid syntax
Thanks for the help so far, any ideas?
@Rapptz Thanks! It is working now! Also thanks @GetRektByMe for getting me to look at the project structure!
So, after clearing the cache, the problem was: I was using Sublime Text to run the Python code but it was still executing the files with Python 3.4
Thanks for all the help 👍
So, I am having trouble trying to get this working. I am using the basic_bot.py example and I keep getting this crazy long error log:
It would seem something is wrong with the package, maybe?
I'm running OS X Yosemite 10.10.5 with Python 3.5.2.
Any help or tips would be appreciated. Thanks!