Reputation: 41
I have a weird problem. I have done multiple Alexa Skills using the Flask Ask Framework.
Today I wanted to test my new Skill but getting the following error:
[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
The error takes place after calling an intent and at the end returing return question(question_string)
The first initial LauchRequest get handled without any problem.
I was thinking of maybe some version problems of my virtual env. But I did a cross check with an old skill (1 month old) where I also was doing a ask request in an intent and it is still working.
I copied the whole virtualenv to the new skill project but still no glory.
Update: Included failing code
@ask.intent('New_Intent')
def new_game():
print 'in New_Intent'
card_title = "Test"
return question(question_string)
Here is the pip freeze Can anyone help me? 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
Upvotes: 0
Views: 190
Reputation: 2110
The error TypeError: 'dict' object is not callable
tells you that question
is not a function of Flask-Ask but a dict
.
My bet is that you declared a variable in the upper scope which is name question
and which is a dict
of questions probably.
The fact that the stacktrace does not dive into Flask-Ask code makes it unrelated to the lib.
Upvotes: 1