Why is importing from a package invalid when the aliased name of package is used?
问题 To make it more clear, consider a numpy example : import numpy as np from numpy import array This works as expected. But what about this: from np import array The output is: Traceback (most recent call last) <ipython-input-21-d5c81fa93e5f> in <module>() ----> 1 from np import array ModuleNotFoundError: No module named 'np' Once I have set the alias of the imported module numpy as np , shouldn't I be able to import something else using np only? Also, the id() of both is the same -- both numpy