【发布时间】:2020-12-01 07:11:46
【问题描述】:
我正在尝试在 python 中使用 flask-ask 和 ngrok 开始为 Alexa 开发一项技能。以下是我的代码:
from flask import Flask
from flask_ask import Ask, statement
app = Flask(__name__)
ask = Ask(app, "/")
@ask.launch
def start_skill():
welcome_message = 'Hello there'
return statement(welcome_message)
@ask.intent("sampleIntent")
def sampleIntent():
return statement('I am the sample intent')
@app.route('/')
def homepage():
return "Hi,there"
if __name__ == '__main__':
app.run(port=7025, debug=True)
代码在我的机器上运行良好,如果我打印出来返回正确的输出,当我查看 ngrok https 链接和 python localhost 链接时,我能够查看文本“Hi,there”。 ngrok 和 python 代码都在同一个 7025 端口上。
我知道问题出在密码学上,因为我安装了 3.0 版。教程指示我降级密码学和 Werkzeug。我能够降级 Werkzeug,但无法降级密码学。点冻结如下:
aniso8601==1.2.0
appdirs==1.4.4
ask-sdk-core==1.14.0
ask-sdk-model==1.24.0
ask-sdk-runtime==1.14.0
ask-sdk-webservice-support==1.2.0
asn1crypto==1.4.0
certifi==2020.6.20
cffi==1.14.1
chardet==3.0.4
click==7.1.2
cryptography==3.0
distlib==0.3.1
filelock==3.0.12
Flask==0.12.1
Flask-Ask==0.9.8
flask-ask-sdk==1.0.0
idna==2.10
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
openssl-python==0.1.1
pycparser==2.20
pyOpenSSL==17.0.0
pyserial==2.7
python-dateutil==2.8.1
PyYAML==3.12
requests==2.24.0
six==1.11.0
Unidecode==1.1.1
urllib3==1.25.10
virtualenv==20.0.30
Werkzeug==0.16.0
当我尝试将密码学降级到版本 2.1.4 时,我收到很多红色文本,但是,第一行似乎是:
Running setup.py install for cryptography ... error
我正在运行 python 版本 3.8.5,我有 pip 版本 20.2.2。
【问题讨论】:
标签: python alexa alexa-skill ngrok