While it is possible to delay an import simply by putting slower stuff above it in your file, it's probably not a good solution to your real problem, which is that you want the behavior that is triggered by the import to be delayed.
A better way to do that is to put that behavior in a function, which you can then call at any time after doing the import. The import is no longer directly triggering the behavior, so you can leave the import statement at the top of the file where most people will expect it to be.
Here are some more simplified examples.
A version based on your current code:
library.py
print("doing stuff")
script.py
import library # oops, this triggers the print too soon
An alternative script with a delay before it imports the library (which is what you're specifically asking for, though not really a great idea):
script.py:
import time
time.sleep(10) # this does the delaying
import library # this triggers the print, but it's unexpected to see an import here
A better solution is to move the behavior of the library into a function, so the time you do the import no longer matters (only the time you call the function):
library.py:
def stuff():
print("doing stuff")
script.py:
import time
import library # we can do the import whenever we want, doesn't cause any printing
time.sleep(10)
library.stuff() # do the stuff here
If you wanted the library module to also be usable as a script, you could add this code to the bottom of the file, so that it calls the function itself some times:
if __name__ == "__main__":
stuff()
The if __name__ == "__main__": line is a bit of boilerplate that checks if the current module is the __main__ module of the program (which is true if it's being run as a script). If instead the module is being imported, that condition will be false, and so the function won't get run (until the real script decides to call it).