Modulenotfounderror: No Module Named 'Fire'
I Am Getting an Error When I Try to Import a Function from Another Python File in the Same Directory. When I Remove the Import the App Runs Fine. Can Anyone...
I am getting an error when I try to import a function from another python file in the same directory. When I remove the import the app runs fine. Can anyone tell my why I am getting the following import error?
I should add that i am running the app my running the start.sh file
start.sh
source venv/bin/activate
export FLASK_APP=myapp.py
flask run
ModuleNotFoundError: No module named 'fire'
routes.py
from flask import render_template
from app import app
from fire import fire
@app.route('/')
@app.route('/index')
def index():
user = {'username': 'Miguelll'}
posts = [
{
'author': {'username': 'John'},
'body': 'Beautiful day in Portland!'
},
{
'author': {'username': 'Susan'},
'body': 'The Avengerss movie was so cool!'
}
]
print(fire())
return render_template('index.html', title='Home', user=user, posts=posts)
fire.py
import pyrebase
config = {
"apiKey": "SNIP",
"authDomain": "SNIP.firebaseapp.com",
"databaseURL": "SNIP",
"storageBucket": "SNIP.appspot.com",
"serviceAccount": "SNIP.json"
}
firebase = pyrebase.initialize_app(config)
def fire():
auth = firebase.auth()
#authenticate a user
user = auth.sign_in_with_email_and_password("[email protected]", "SNIPSNIPSNIP$")
all_agents = db.child("items").get(user['idToken']).val()
print(all_agents)
My Directory structure(Why is this image so big ha):
1 Answer
I needed to change my import to
from app.fire import fire