close

[Solved] AttributeError: ‘module’ object (scipy) has no attribute ‘misc’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error AttributeError: ‘module’ object (scipy) has no attribute ‘misc’ in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How AttributeError: ‘module’ object (scipy) has no attribute ‘misc’ Error Occurs?

Today I get the following error AttributeError: ‘module’ object (scipy) has no attribute ‘misc’ in python.

How To Solve AttributeError: ‘module’ object (scipy) has no attribute ‘misc’ Error ?

  1. How To Solve AttributeError: 'module' object (scipy) has no attribute 'misc' Error ?

    To Solve AttributeError: 'module' object (scipy) has no attribute 'misc' Error Because you cannot directly use the misc module from scipy without explicitly import it. Here is the way of loading scipy.misc:

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

    To Solve AttributeError: 'module' object (scipy) has no attribute 'misc' Error Because you cannot directly use the misc module from scipy without explicitly import it. Here is the way of loading scipy.misc:

Solution 1

>>> import scipy
>>> scipy.misc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'misc'
>>> 
>>> 
>>> import scipy.misc
>>> scipy.misc.imsave
<function imsave at 0x19cfa28>
>>>

Which seems to be quite common with scipy.

Solution 2

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()
...

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read