An import statement that appears in the code is not in the global scope. The import statement can only appear in the global scope.
To correct this error
-
Move the import statement from the current location to the main program block (the global scope.)