k.ko3n
k.ko3n

Reputation: 954

No module named 'scipy.io.matlab'

import sklearn.preprocessing returns the following error message.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-8931cbb9678f> in <module>
      1 import numpy as np
----> 2 import sklearn.preprocessing

~\AppData\Roaming\Python\Python37\site-packages\sklearn\preprocessing\__init__.py in <module>
      4 """
      5 
----> 6 from ._function_transformer import FunctionTransformer
      7 
      8 from .data import Binarizer

~\AppData\Roaming\Python\Python37\site-packages\sklearn\preprocessing\_function_transformer.py in <module>
      3 from ..base import BaseEstimator, TransformerMixin
      4 from ..utils import check_array
----> 5 from ..utils.testing import assert_allclose_dense_sparse
      6 from ..externals.six import string_types
      7 

~\AppData\Roaming\Python\Python37\site-packages\sklearn\utils\testing.py in <module>
     19 
     20 import scipy as sp
---> 21 import scipy.io
     22 from functools import wraps
     23 from operator import itemgetter

~\AppData\Roaming\Python\Python37\site-packages\scipy\io\__init__.py in <module>
     95 
     96 # matfile read and write
---> 97 from .matlab import loadmat, savemat, whosmat, byteordercodes
     98 
     99 # netCDF file support

ModuleNotFoundError: No module named 'scipy.io.matlab'

I use Windows. The following packages are already installed in Python 3.7.3:
scipy 1.1.0
numpy 1.16.2
scikit-learn 0.20.3

Any help is appreciated.

Upvotes: 1

Views: 2425

Answers (1)

k.ko3n
k.ko3n

Reputation: 954

Based on the comment from @Jeril above, my issue has been resolved. It was because Scipy was not from the most recent version.

Here are the steps:
1. Download package(s) from here. Please write some warnings in the Intro section.
2. If needed, copy+paste the downloaded file to Python directory. In my machine, it is located in C:\Python\Python36.
3. Open command prompt then cd to the directory where the downloaded file is saved.
4. pip install packagefilename.whl. Before, make sure that pip is updated.

Upvotes: 2

Related Questions