我有一个奇怪的问题。我使用Flask Ask Framework完成了多个Alexa技能。
今天我想测试我的新技能,但收到以下错误:
[2018-03-29 17:04:59,502] ERROR in app: Exception on / [POST]
Traceback (most recent call last):
File "/private/var/folders/sf/pjbf21sx63n02j9cpb0hyvq80000gn/T/pip-build-3pF7O7/Flask/flask/app.py", line 1982, in wsgi_app
17:04:59
File "/private/var/folders/sf/pjbf21sx63n02j9cpb0hyvq80000gn/T/pip-build-3pF7O7/Flask/flask/app.py", line 1614, in full_dispatch_request
17:04:59
File "/private/var/folders/sf/pjbf21sx63n02j9cpb0hyvq80000gn/T/pip-build-3pF7O7/Flask/flask/app.py", line 1517, in handle_user_exception
17:04:59
File "/private/var/folders/sf/pjbf21sx63n02j9cpb0hyvq80000gn/T/pip-build-3pF7O7/Flask/flask/app.py", line 1612, in full_dispatch_request
17:04:59
File "/private/var/folders/sf/pjbf21sx63n02j9cpb0hyvq80000gn/T/pip-build-3pF7O7/Flask/flask/app.py", line 1598, in dispatch_request
17:04:59
File "/private/var/folders/sf/pjbf21sx63n02j9cpb0hyvq80000gn/T/pip-build-3pF7O7/flask-ask/flask_ask/core.py", line 670, in _flask_view_func
17:04:59
File "/var/task/millions.py", line 150, in new_game
17:04:59
return question(question_string)
17:04:59
TypeError: 'dict' object is not callable
错误发生在调用intent之后,最后是returing返回问题(question_string)
第一个初始的LauchRequest处理没有任何问题。
我在想我的虚拟环境可能存在一些版本问题。但是我用一项旧技能(1个月大)进行了交叉检查,我也在意图中提出请求,但它仍在工作。
我将整个virtualenv复制到新的技能项目中,但仍然没有荣耀。
更新:包含失败的代码
@ask.intent('New_Intent')
def new_game():
print 'in New_Intent'
card_title = "Test"
return question(question_string)
这是pip冻结任何人都可以帮助我吗? BR
aniso8601==1.2.0
argcomplete==1.9.2
asn1crypto==0.24.0
awscli==1.14.33
base58==0.2.4
beautifulsoup4==4.6.0
boto3==1.5.23
botocore==1.8.37
bs4==0.0.1
certifi==2018.1.18
cffi==1.11.4
cfn-flip==1.0.0
chardet==3.0.4
click==6.7
colorama==0.3.7
cryptography==2.1.4
docutils==0.14
durationpy==0.5
enum34==1.1.6
Flask==0.12.1
Flask-Ask==0.9.7
future==0.16.0
futures==3.1.1
hjson==3.0.1
idna==2.6
ipaddress==1.0.19
itsdangerous==0.24
Jinja2==2.10
jmespath==0.9.3
kappa==0.6.0
lambda-packages==0.19.0
MarkupSafe==1.0
placebo==0.8.1
pyasn1==0.4.2
pycparser==2.18
pyOpenSSL==17.0.0
python-dateutil==2.6.1
python-slugify==1.2.4
PyYAML==3.12
requests==2.18.4
rsa==3.4.2
s3transfer==0.1.12
six==1.10.0
toml==0.9.4
tqdm==4.19.1
troposphere==2.2.0
Unidecode==1.0.22
urllib3==1.22
Werkzeug==0.12
wsgi-request-logger==0.4.6
zappa==0.45.1
答案 0 :(得分:1)
错误TypeError: 'dict' object is not callable
告诉您question
不是Flask-Ask的函数,而是dict
。
我敢打赌,你在上层范围内声明了一个名为question
的变量,可能是dict
个问题。
堆栈跟踪没有深入Flask-Ask代码的事实使它与lib无关。