使用Google App Engine时无法导入Flask [英] Can't import Flask while using Google App Engine
问题描述
我遵循本指南并尝试开发Flask应用程序以在Google App Engine上运行。我遵循指导的信,但是当我从启动程序启动开发应用程序服务器,并转到 http:// localhost:8080 / / $>,我得到一个HTTP 500错误。 我检查日志,它说 有没有办法解决这个问题? 使用GAE和Flask工作我已经意识到这一点: 直接使用Python 要使用python直接运行应用程序( 使用dev_appserver.py运行 为了使用GAE SDK提供的dev_appserver.py运行应用程序,您需要在项目中包含所有相关的包,如下所示:Flask,jinja2 ...查看我的另一个答案示例配置这个包: https://stackoverflow.com/a/14248647/1050818 在Windows上运行Python,Virtualenv,Flask和GAE 安装setuptools MS Windows安装程序(必须在Windows上安装PIP) 安装PIP 安装Virtualenv 安装Google App Engine SDK 创建项目 (查看代码示例: https: //github.com/maxcnunes/flaskgaedemo ) 安装Flask以在本地运行 使用GAE SDK运行应用程序 I'm following this guide and trying to develop a Flask app to run on the Google App Engine. I followed the guide to the letter but when I launch the dev app server from the Launcher and go to http://localhost:8080/, I get a HTTP 500 error. I check the logs and it says Is there a way to fix this? Working a bit with GAE and Flask I have realized this: Running directly with Python To run the app with python directly ( Running with dev_appserver.py To run the app with the dev_appserver.py provided by GAE SDK you need have all dependent packages inside your project, as: Flask, jinja2... Look in my another answer a example how to configure this packages : https://stackoverflow.com/a/14248647/1050818 Running Python, Virtualenv, Flask and GAE on Windows Install Python Install setuptools MS Windows installer (Necessary to install PIP on Windows) Install PIP Install Virtualenv Install Google App Engine SDK Create the project (Look a example of the code here: https://github.com/maxcnunes/flaskgaedemo ) Install Flask to run Locally Install Flask to run on the GAE Running the application with GAE SDK
这篇关于使用Google App Engine时无法导入Flask的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
没有名为flask的模块
。然后,我通过运行 import flask
来检查管理控制台中的交互式控制台,并得到相同的错误消息。
python app.py
),您需要在您的环境中安装依赖项包命令: pip install flask
已更新
$ b 在停止Python
; C:\\ b
在值和保存的结尾
$ b
pip install virtualenv
mkdir c:\virtualenvs
创建一个虚拟Envs文件夹
cd c:\virtualenvs
来访问该文件夹
virtualenv flaskdemo
为您创建一个virtualenv项目
c: \virtualenvs\flaskdemo\scripts\activate
pip install flask
No module named flask
. Then I check the interactive console in the admin console by running import flask
and I get the same error message. I can import flask in any other python file without error.python app.py
) you need have the dependents packages installed in your environment using the command: pip install flask
UPDATED
;C:\Python27;C:\Python27\Scripts
at the end of the value and save
python setup.py install
pip install virtualenv
mkdir c:\virtualenvs
to create a folder to the Virtual Envscd c:\virtualenvs
to access that foldervirtualenv flaskdemo
to create a virtualenv for you projectc:\virtualenvs\flaskdemo\scripts\activate
pip install flask