【问题标题】:Google AppEngine error: "No module named flask"Google AppEngine 错误:“没有名为 flask 的模块”
【发布时间】:2012-05-20 15:24:42
【问题描述】:

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

希望获得有关如何解决的任何见解/帮助。

【问题讨论】:

    标签: google-app-engine flask


    【解决方案1】:

    我不知道你是否已经这样做了,但是要使用 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
    

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2011-11-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-05-17
        • 1970-01-01
        • 2021-04-07
        • 2016-07-04
        相关资源
        最近更新 更多