title: Can't load 'mnist-original' dataset using sklearn
body: <p><em>This question is similar to what asked <a href="https://stackoverflow.com/questions/26102261/io-error-when-using-datasets-fetch-mldata-in-sklearn">here</a> and <a href="https://stackoverflow.com/questions/19530383/how-to-use-datasets-fetch-mldata-in-sklearn/35048327#35048327">here</a>. Unfortunately, in my case the suggested solution didn't fix the problem.</em> </p>
  
  <p>I need to work with the MNIST dataset but I can't fetch it, even if I specify the address of the <code>scikit_learn_data/mldata/</code> folder (see below). How can I fix this?</p>
  
  <p>In case it might help, I'm using Anaconda. </p>
  
  <p>Code:</p>
  
  <pre><code>from sklearn.datasets.mldata import fetch_mldata
  
  dataset = fetch_mldata('mnist-original', data_home='/Users/michelangelo/scikit_learn_data/mldata/')
  mnist = fetch_mldata('MNIST original')
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  IOError                                   Traceback (most recent call last)
  &lt;ipython-input-5-dc4d45bc928e&gt; in &lt;module&gt;()
  ----&gt; 1 mnist = fetch_mldata('MNIST original')
  
  /Users/michelangelo/anaconda2/lib/python2.7/site-packages/sklearn/datasets/mldata.pyc in fetch_mldata(dataname, target_name, data_name, transpose_data, data_home)
      168     # load dataset matlab file
      169     with open(filename, 'rb') as matlab_file:
  --&gt; 170         matlab_dict = io.loadmat(matlab_file, struct_as_record=True)
      171 
      172     # -- extract data from matlab_dict
  
  /Users/michelangelo/anaconda2/lib/python2.7/site-packages/scipy/io/matlab/mio.pyc in loadmat(file_name, mdict, appendmat, **kwargs)
      134     variable_names = kwargs.pop('variable_names', None)
      135     MR = mat_reader_factory(file_name, appendmat, **kwargs)
  --&gt; 136     matfile_dict = MR.get_variables(variable_names)
      137     if mdict is not None:
      138         mdict.update(matfile_dict)
  
  /Users/michelangelo/anaconda2/lib/python2.7/site-packages/scipy/io/matlab/mio5.pyc in get_variables(self, variable_names)
      290                 continue
      291             try:
  --&gt; 292                 res = self.read_var_array(hdr, process)
      293             except MatReadError as err:
      294                 warnings.warn(
  
  /Users/michelangelo/anaconda2/lib/python2.7/site-packages/scipy/io/matlab/mio5.pyc in read_var_array(self, header, process)
      250            `process`.
      251         '''
  --&gt; 252         return self._matrix_reader.array_from_header(header, process)
      253 
      254     def get_variables(self, variable_names=None):
  
  mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.array_from_header()
  
  mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.array_from_header()
  
  mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_real_complex()
  
  mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_numeric()
  
  mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_element()
  
  streams.pyx in scipy.io.matlab.streams.FileStream.read_string()
  
  IOError: could not read bytes
  </code></pre>