title: Python 3 - Copy files if they do not exist in destination folder
body: <p>I am attempting to move a couple thousand pdfs from one file location to another. The source folder contains multiple subfolders and I am combining just the pdfs (technical drawings) into one folder to simplify searching for the rest of my team.</p>
  <p>The main goal is to only copy over files that do not already exist in the destination folder. I have tried a couple different options, most recently what is shown below, and in all cases, every file is copied every time. Prior to today, any time I attempted a bulk file move, I would received errors if the file existed in the destination folder but I no longer do.</p>
  <p>I have verified that some of the files exist in both locations but are still being copied. Is there something I am missing or can modify to correct?</p>
  <p>Thanks for the assistance.</p>
  <pre><code>import os.path
  import shutil
  
  source_folder = os.path.abspath(r'\\source\file\location')
  
  dest_folder = os.path.abspath(r'\\dest\folder\location')
  
      for folder, subfolders, files in os.walk(source_folder):
          for file in files:
              path_file=os.path.join(folder, file)
              if os.path.exists(file) in os.walk(dest_folder):
                  print(file+&quot; exists.&quot;)
              if not os.path.exists(file) in os.walk(dest_folder):
                    print(file+' does not exist.')
                    shutil.copy2(path_file, dest_folder)
  </code></pre>