Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
1

Invalid Syntax

BLA4KM4MBA
BLA4KM4MBA

Hey there, so i wanna host my discord.py 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 "main.py", line 1, in
import discord
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/init.py", line 25, in
from .client import Client
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 27, in
import asyncio
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/asyncio/init.py", line 21, in
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
 Can somebody help me with this? TIA!

2 years ago

Voters

Comments

TopNew
2
nviotti95
nviotti95

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

10 months ago
1
djkozutie678
djkozutie678

@nviotti95
should I reinstall after removing it?

4 months ago
1
IVIicrosoftEdge
IVIicrosoftEdge

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.

1 year ago
1
YuvanVighnesh
YuvanVighnesh

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

2 years ago
1
Axrevyn
Axrevyn

Try deleting the packager files and reinstalling?

2 years ago
Load more