import nt print nt.__file__ I have done above ones as you stated. I'm getting an error Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute '__file__'