Ask coding questions

← Back to all posts
errors
jonnyb2244 (1)

Traceback (most recent call last):
File "main.py", line 9, in <module>
for cog in filter(lambda x: x.endswith(".py"), listdir("cogs/")):
FileNotFoundError: [Errno 2] No such file or directory: 'cogs/'

still getting errors, how do i fix it?

Comments
hotnewtop
Coder100 (16802)

you don't have a cogs folder.

AloegelhiPlaysR (104)

You need a folder called 'cogs' and a file within that folder.

AloegelhiPlaysR (104)

Make a folder.. If you don't know basic python, I recommed learning before making a bot.

@jonnyb2244

jonnyb2244 (1)

@AloegelhiPlaysR what should i put, in the cog folder?
i tried to run it on pycharm and vsc, but wouldnt work. So i copied it, to replit