You have to put the import inside the function definition.