question

newuser-c90b2835-2550-4279-8200-b413cc8a57f0 avatar image

ASK Python SDK suggestion

I am using the python SDK for ASK and was successful in building the hello world demo.

I put the hello_world.py in to the same directory where the sdk was installed.

I have something like below

skill

---skill_env

---all the sdk packages like ask_sdk_core and so on

---hello_world.py

As there are many packages and I have decided to move my hello_world.py to a level above

skill

---skill_env

------all the packages

---hello_world.py

I have made changes to the packages import

before

from ask_sdk_core.dispatch_components import AbstractRequestHandler

After

from skill_env.ask_sdk_core.dispatch_components import AbstractRequestHandler

After making this change and deploying to AWS lambda, I get the below error

Unable to import module 'hello_world': No module named 'ask_sdk_model'

I am new to python and I am not sure what I am doing wrong. Do I have to reinstall the packages again to a different sub-directory to make it to work / any other setting updates need to be done.

I would prefer to have all the ask-sdk in one folder as I would like to have my modules in seperate folders for better seggregation

alexa skills kitsdkpython
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Anand@Amazon avatar image
Anand@Amazon answered

Hello Developer,

You have to write your Hello World in a single python file named hello_world.py. In the the same folder where you have downloaded all ask libraries, use your favorite text editor or IDE to create a file named hello_world.py.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.