"main.py" file not found

Question:
why am i getting errror in running a simple python file? The error is always “main.py” file not found even when it was there so i deleted it and even then i get the same error. why ?
i need help and quick…

Repl link:
https://replit.com/@PiyushJ2/test-repl-by-Piyush#print.py

code snippet

Can you tell more? Code and error?

If you want replit to run any file other than main.py in a python repl, you must change the entrypoint and run commands in .replit.

5 Likes

well, how do i do that? where’s the entry point ? It’s my first time using repl.it and i have wasted two hours doing nothing productive, please tell

You need to select the show hidden file clicking on the 3 vertical dots.
Open .replit and change the file name in the run =" command

only “command” ? is there any other change that i must make. ?

Yes, you must change entrypoint.

as fire pup said

just edit the file .repilit to and where it has run = “python3 main.py” name it to print.py or right click it and press rename it to print.py like this
Screenshot 2023-04-06 10.57.19 AM
click on the three sots on the file window
then click on show hidden files


click on .replit and you should find the thing on top then change

entrie point and run to print.py then you are done
hope that helps

4 Likes

will i have to keep doing this for every new file? is there no other solution?

And thanks for all the help

more reliable would be to just have a separate repl for each program, but see

1 Like

I have another solution but it’s not too practical either. It may be possible to completely automate this using listdir but I haven’t tried it. @UMARismyname’s solution is probably the best.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.