This will fail some times depending on where the python script file is in relation to the sdk directory.
The 2 options I can suggest:
1- Write the code on your desktop and get comfortable with the layout of the sdk and script files
2- Make sure the python script you are running is located in the root of the sdk directory