'I was creating a discord music bot on Repl.it and this error keeps showing
Traceback (most recent call last):
File "main.py", line 1, in <module>
import asyncio
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/__init__.py", line 21, in <module>
from .base_events import *
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/base_events.py", line 296
future = tasks.async(future, loop=self)
^
SyntaxError: invalid syntax
someone told me to install asyncio and so I did it seemed like some of the problems were gone but it still has an error pls help
Solution 1:[1]
Tasks don't use async, they use .loop
Solution 2:[2]
Findings:
- asyncio is not needed for python3.8. It was merged into python-core, see this: https://pypi.org/project/asyncio/
- Removing asyncio worked for me
Steps:
- Go to your python installation site-packages path
- Verify asyncio is actually there:
ls -al | grep asyncio - Remove asyncio manually:
rm -rf asyncio - Repeat for the .dist-info related to asyncio
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | General Grievance |
| Solution 2 | alejo |
