Google AppEngine错误:“没有名为flask的模块”

时间:2012-05-12 05:44:47

标签: google-app-engine flask

我按照WebPutty's github页面提供的指示将我自己的WebPutty分支放在GAE上。它在当地运行良好。我无法成功运行“fab deploy”(得到错误“没有名为appengine.api的模块”),所以转而尝试通过appcfg.py更新将它放在GAE上。不幸的是,当我访问URL时,这会给我以下错误:“没有名为flask的模块”。

非常喜欢有关如何解决的任何见解/帮助。

2 个答案:

答案 0 :(得分:3)

我不知道你是否已经这样做了,但是要使用GAE和python,你需要在你的项目中使用依赖包,如Flask,Werkzeug,Jinja2和SimpleJson。

这里有我在项目中使用的脚本:

# set the path of your project
PATH_PROJECT=~/Development/python/projects/scheduler-i-sweated-yesterday

cd ~/Downloads

#
# Installing Flask: https://github.com/mitsuhiko/flask/tags
#
wget https://github.com/mitsuhiko/flask/archive/0.9.zip
unzip 0.9.zip
mv flask-0.9/flask $PATH_PROJECT/flask

#
# Installing Werkzeug: https://github.com/mitsuhiko/werkzeug/tags
#
wget https://github.com/mitsuhiko/werkzeug/archive/0.8.3.zip
unzip 0.8.3.zip
mv werkzeug-0.8.3/werkzeug $PATH_PROJECT/werkzeug

#
# Installing Jinja2: https://github.com/mitsuhiko/jinja2/tags
#
wget https://github.com/mitsuhiko/jinja2/archive/2.6.zip
unzip 2.6.zip
mv jinja2-2.6/jinja2 $PATH_PROJECT/jinja2

#
# Installing SimpleJson: https://github.com/simplejson/simplejson/tags
#
wget https://github.com/simplejson/simplejson/archive/v3.0.5.zip
unzip v3.0.5.zip
mv simplejson-3.0.5/simplejson $PATH_PROJECT/simplejson

另存为install_packages_dependencies.sh,然后在shell中运行:

bash install_packages_dependencies.sh

答案 1 :(得分:2)

我有同样的问题。我在Mac OS X Lion上。我通过将GoogleAppEngineLauncher.app从桌面移动到应用程序目录来解决问题。 fabfile.py在那里寻找应用程序。在我将应用程序移动到fabfile.py寻找它之后,我运行了“fab deploy”,一切都运行良好。我希望这会有所帮助。