Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Rodrigo Muñoz
Courses Plus Student 20,171 PointsUsing Flask on Google App Engine
I have installed virtual environment successfully but it seems it doesn't recognize the site-packages. If anyone could help, I would really appreciated. Here is what I've done:
Running virtual environment, installed flask using pip install flask. Then here is the code I've done.
import sys
import os
sys.path.insert(1, os.path.join(os.path.abspath('.'),'venv/lib/python3.4/site-packages'))
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from localhost!"
if __name__ == "__main__":
app.run()
1 Answer
sangsatori
2,761 PointsI can't help but notice your code is referencing Python 3.4. You are aware that Google App Engine supports only Python 2.7, right?
Rodrigo Muñoz
Courses Plus Student 20,171 PointsRodrigo Muñoz
Courses Plus Student 20,171 PointsYou are right Arnis Jaundžeikars I think this won't work. But I've got it working on localhost. Thanks for the help by the way.
UPDATE: Google App Engine now support Flask, Django and Bottle. You need to import the libraries that
pipis supose to do. Login to Google App Engine with a newest account and you will see the tutorial.