Python: import function from an already imported module
问题 Suppose I have a python package my_package which contains a module my_module which contains a function my_function . I was trying to do the following import in python interactive shell: >>> from my_package import my_module >>> my_module.my_function() # => OK >>> from my_module import my_function # => ImportError: No module named my_module >>> from my_package.my_module import my_function # => OK I am quite surprised at the ImportError at the third line above: since the my_module is already