in a python file, how to check the version of all the libraries that are imported exactly in that file by "import xxxxxxxxxxxx".
This is useful to later make an environment that has enough library to run that script while don't need to clone the exact environment.
example:
import pandas
import tensorflow
def version_list():
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# expect the version_list to return
# pandas==xxx tensorflow==xxx
# without returning other things