Flask-Web-App-Tutorial icon indicating copy to clipboard operation
Flask-Web-App-Tutorial copied to clipboard

Can't run the code

Open Opineda930 opened this issue 3 years ago • 5 comments

I keep getting this error: ( can't find 'main')

Anyone know why ?

this is in the main.py file

it says that it cant find that module

Opineda930 avatar Jun 16 '21 03:06 Opineda930

In main.py, at the if statement at the bottom, does it say if __name__ == '__main__':? Possible duplicate: https://github.com/techwithtim/Flask-Web-App-Tutorial/issues/15

Sorry if this isn't enough help. I don't have information about how your code is written. Unless you modified the code, it should run fine.

elpython3 avatar Jun 30 '21 00:06 elpython3

Thank you yes it does say that but still won't run thank you tho, it stickler says it can't define main

Opineda930 avatar Jun 30 '21 00:06 Opineda930

Could you send your code? It's pretty hard to answer if you don't have the code. Unless if you modified the code, it might be with what you're working with (IDE, python version, etc)

elpython3 avatar Jun 30 '21 00:06 elpython3

Before PRs You Must Watch Video

M-fazin avatar Jul 28 '21 05:07 M-fazin

ile "/Users/mirceaalexandru/Desktop/projectpython/website/init.py", line 22, in create_app from .models import User, Note ImportError: cannot import name 'User' from 'website.models' (/Users/mirceaalexandru/Desktop/projectpython/website/models.py)

Cifre123 avatar Aug 31 '21 19:08 Cifre123