打印输出python3某一个包的具体位置
-
import a_module print(a_module.__file__)
however: AttributeError: 'module' object has no attribute '__file__'
-
import inspect inspect.getfile(module)
successful !
ref:
https://stackoverflow.com/questions/247770/how-to-retrieve-a-modules-path