Why does this AttributeError in python occur?

后端 未结 4 1090
孤街浪徒
孤街浪徒 2020-12-01 07:41

There is one thing, that I do not understand.

Why does this

import scipy # happens with several other modules, too. I took scipy as an example now...         


        
4条回答
  •  醉梦人生
    2020-12-01 08:07

    The default namespace in Python is "__main__". When you use import scipy, Python creates a separate namespace as your module name. The rule in Pyhton is: when you want to call an attribute from another namespaces you have to use the fully qualified attribute name.

提交回复
热议问题