Skip to content
Sign upLog in
← Back to Community

Invalid Syntax

Profile icon

Hey there, so i wanna host my bot on repl but when i run it it give a syntax error i have imported all the packages Error:
Traceback (most recent call last):
File "", line 1, in
import discord
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/", line 25, in
from .client import Client
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/", line 27, in
import asyncio
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/", line 21, in
from .base_events import *
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/", line 296
future = tasks.async(future, loop=self)
SyntaxError: invalid syntax
 Can somebody help me with this? TIA!

Profile icon
Profile icon

For whoever will have this problem in the future:
I fixed it like so:

  • Uninstall asyncio package via the Replit window
  • In replit files, click on the 3 dots and "Show Hidden files"
  • Go to /venv/lib/pythonX.X/site-packages
  • Delete the asyncio( NOT THE ASYNC!) files

It worked for me after i tried to install asyncio package and totally messed up my projet, hope it helped

Profile icon

should I reinstall after removing it?

Profile icon

I was getting this problem too, and just figured out it might be the asyncio package. Go to your packages and delete asyncio, but otherwise leave your code alone and it should work.

Profile icon

Instead of
await client.send_message`` use await client.send```

Profile icon

Try deleting the packager files and reinstalling?