Just wanted to get the package name of a given module, why does not the dunder package attribute work?
import sys, inspect, os, numpy as np
print("The os package name is " + os.__package__)
print("The np package name is " + np.__package__)
print("The inspect package name is " + inspect.__package__)
print("The sys package name is " + sys.__package__)
What I get from the above is as follows.
The os package name is
The np package name is numpy
The inspect package name is
The sys package name is
As you can see, it works only for numpy and does not work for others. Can someone enlighten me why? What am I missing?