Skip to content
Home » AttributeError: ‘module’ object has no attribute ‘misc’

AttributeError: ‘module’ object has no attribute ‘misc’

To solve AttributeError: ‘module’ object (scipy) has no attribute ‘misc’ error follow below methods.

ERROR LOG

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'misc'

How to solve AttributeError: ‘module’ object (scipy) has no attribute ‘misc’ ?

Refer the given methods to solve the issue.

Method 1:

Because you cannot use the misc module directly from scipy without first importing it. The following is how to load scipy.misc:

>>> import scipy.misc
>>> scipy.misc.imsave
<function imsave at 0x23ccb17>

Method 2 :

You must import scipy.misc explicitly as:

  1. scipy.misc import
  2. If it is not already installed, you must install the package pillow ( PIL ). Pillow must be installed for scipy.misc image processing functions like imread() and imsave() to work properly. To confirm, either run your code again or enter the following command:
scipy.misc.imread

Hope the above solution works.

Also read : Unicode error handling with Python readlines()