Skip to content
← Back to Community
no such file
Profile icon
wuwls11

Hey, I am a newbie on this ground.

Recently, I have started making fun and blah blah for 2 days?

But, somehow whatever I try, the console just says no such file: main.py.

So I have tried changing names of files, making another folder for it, but it never works.

Get me a help, plz. ;)

Voters
Profile icon
EthanZerr1533
Profile icon
DaffiShigeo
Profile icon
juanbustamante3
Profile icon
BryanArriaga1
Profile icon
GuyMoshe
Profile icon
thefunbun95
Profile icon
MatteoPesenti1
Profile icon
PlazmaAngel
Profile icon
jack23805270
Profile icon
wuwls11
Comments
hotnewtop
Profile icon
Wumi4

It is because by default, Repl takes the Python file main.py as an entry point. Every time you run a Python Repl, It will run the file main.py.

To fix this, there are 2 ways:

  • Open the Shell tab next to Console tab, then type:
python3 <your_file_here.py>
  • Create a file called .replit, then type in:
run = "python3 <your_file_here.py>"

Note that I can't confirm that the second way will work, so can someone confirm me about the second way?

Profile icon
OldWizard209

The second way will always work. No need for the 3 in python 3 if ur repl is of python 3 itself. @Wumi4