Why does this AttributeError in python occur?

后端 未结 4 1109
孤街浪徒
孤街浪徒 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:04

    AttributeError is raised when attribute of the object is not available.

    An attribute reference is a primary followed by a period and a name:

    attributeref ::= primary "." identifier

    To return a list of valid attributes for that object, use dir(), e.g.:

    dir(scipy)
    

    So probably you need to do simply: import scipy.sparse

提交回复
热议问题