Flask Import Error With Request Module
PREFACE Hello all I am getting a very strange error when I am trying to use the flask module for python... First let me explain that I first started writing the program and then it
Solution 1:
Actually the 2 statements is doing nearly the same:
from flask import *
import flask
when you try to use a method in flask, you have 2 choices: 1st:
from flask import *
c = request.remote_addr
2nd:
importflaskc= flask.request.remote_addr
Do you notice the different?When using from a_module import *
, you can just use the method name in the module.When using import a_module
, you have to the compiler which module you use, such as: a_module.method_name
Solution 2:
Sometimes directories break... Try copying the files out of the directory and make a new directory and then rerun the server that should work.
I figured this out because it worked before and then it worked again. Your code is just fine!
Post a Comment for "Flask Import Error With Request Module"