python - Error while running the simplest flask app -


Help me understand the problem of this code as you are seeing it are only two lines of code Flask import flask app = flask (__name__)

to

  return type erro.   C: \ Users \ Natali \ AppData \ Local \ Enthought \ Canopy32 \ User \ lib \ site-packages \ flask \ app .poc "-> 622 prefix, package_path = find_package (self.import_name) 623 if no prefix is: 624 Return os.path.join (package_path, 'instance') C: \ user \ Natalie \ AppData \ Local \ Enthought \ Canopy32 656 "" 660 root_mod_name = import_name.split ('.') [0] - & gt; \ User \ lib \ site-packages \ flask \ helpers \ uCP find_package (import_name) 661 loader = pkgutil.get_loader (root_mod_name) 662 if there is no loader or import_name == '__main__': 663 # import name is not found, or Get_loader (module_or_name) 462 in interactive / main module C: \ Program Files \ Enthought \ Canopy32 \ app \ appdata \ canopy32 -1.3.0.1715.win-x86 \ lib \ pkgutil.pyc Second: 463 Full Name = Mod_Or_Name - & gt; 464 Return Search_loader (full name) 465 466 Def search_loader (full name): C: \ Program Files \ Anthit \ canopy 32 app \ apatata \ canopy-1.3.0.1715.ww-x86 \ lib \ pkgutil.pyc find_loader (full name) 473 " 474 for importer in iter_importers (fullname): - & gt; 475 loader = importer.find_module (full name) 476 if there is no loader no: 477 return loader type error: find_module () fine 3 arguments (2 given)   

Sorry for a long error code.Why does this happen?

You need to save the code in the first code, and then run it from the command line. It will not work just by typing in the interactive prompt.

The minimum flask application looks:

Save this code to a file (for example, server.py ) and then python server.p Run with y .

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -