title: Python: existing file not found (IOError: [Errno 2]) when using os.walk
body: <p>I have set up the following directory:</p>
  
  <pre><code>+---main
  |   |   
  |   +---sub1
  |   |       file1.xlsx
  |   | 
  |   +---sub2
  |   |       file2.xlsx
  |   |
  |   \---sub3
  |           file3.xlsx
  </code></pre>
  
  <p>I want to access each file and compute the mean value of its <code>A1:A10</code> cells, but while <code>file1.xlsx</code> exists, I get this error:</p>
  
  <p><code>IOError: [Errno 2] No such file or directory: 'file1.xlsx'</code></p>
  
  <p>My code as of now (it is designed to iterate over many "main" directories):</p>
  
  <pre><code>import os
  from openpyxl import load_workbook
  
  directoryPath=r'C:\Users\MyName\Desktop\MainFolder'
  os.chdir(directoryPath)
  folder_list=os.listdir(directoryPath)
  for folders, sub_folders, file in os.walk(directoryPath):
      for name in file:
          if name.endswith(".xlsx"):
              filename=os.path.basename(name)
              wb=load_workbook(filename)
              cell_range = wb['A1':'A10']
  
              #computing the mean value
  </code></pre>
  
  <p>The error points at <code>wb=load_workbook(filename)</code>. Why do I get it and how to fix it?</p>