我試圖在谷歌應用程序引擎中使用此link部署樣本瓶示例。當我嘗試在本地使用dev_appserver.py運行它時,它工作正常。但是在部署它谷歌雲,它不斷顯示我導入燒瓶錯誤。ImportError:無法導入應用程序引擎中的名稱瓶
通過所有的stackoverflow解決方案,但沒有任何工作。 請告訴我,我做錯了
main.py
# [START app]
import logging
import sys
from os.path import expanduser, os, dirname
from flask import Flask, render_template, request
user_home = expanduser("~")
sys.path.append(user_home + 'flask/lib')
app = Flask(__name__)
# [START form]
@app.route('/form')
def form():
return render_template('form.html')
# [END form]
# [START submitted]
@app.route('/submitted', methods=['POST'])
def submitted_form():
name = request.form['name']
email = request.form['email']
site = request.form['site_url']
comments = request.form['comments']
# [END submitted]
# [START render_template]
return render_template(
'submitted_form.html',
name=name,
email=email,
site=site,
comments=comments)
# [END render_template]
@app.errorhandler(500)
def server_error(e):
# Log the error and stacktrace.
logging.exception('An error occurred during a request.')
return 'An internal error occurred.', 500
的app.yaml
runtime: python27
api_version: 1
threadsafe: true
entrypoint: gunicorn -b :$PORT main.app
# [START handlers]
handlers:
- url: /.*
script: main.app
# [END handlers]
它給我下面的錯誤,同時部署: 錯誤:在解析文件 庫「燒瓶」不支持 – laughingmn