title: How to perform the linux equivalent of "cp -r" in python
body: <p>How to recursively copy directories (<code>cp -r</code>) in Python?</p>
  
  <p><a href="https://docs.python.org/3.5/library/shutil.html#shutil.copytree" rel="nofollow noreferrer">os.copytree</a> results in <code>FileExistsError: [Errno 17] File exists:</code>.</p>
  
  <p>And <a href="https://docs.python.org/3.5/distutils/apiref.html#distutils.dir_util.copy_tree" rel="nofollow noreferrer">distutils.dir_util.copy_tree</a> raises <code>AttributeError: module 'distutils' has no attribute 'dir_util'</code></p>
  
  <p>How to perform the linux equivalent on <code>cp -r</code> in Python?</p>