AttributeError: 'module' object (scipy) has no attribute 'misc'

前端 未结 4 762
無奈伤痛
無奈伤痛 2020-12-01 09:58

I updated from ubuntu 12.04 to ubuntu 12.10 and the python module I have written suddenly no longer works with the error message that the module scipy does not have the attr

4条回答
  •  暖寄归人
    2020-12-01 10:53

    Because you cannot directly use the misc module from scipy without explicitly import it. Here is the way of loading scipy.misc:

    import scipy.misc
    
    #Load the Lena image into an array, (yes scipy does have a lena function)
    lena = scipy.misc.lena()
    ...
    

提交回复
热议问题