I am trying to copy an image from one folder to another folder using shutil in python 3.6 windows 10, but am running into permission errors.
I have my source saved as a variable named 'src' which contains
src = "C:/Users/marti/AppData/Roaming/vlc/art/artistalbum/artistname/art.jpg"
and my destination named 'src' which contains
dst = "C:/Users/marti/Desktop/MRL/cover"
my file currently imports these things:
from shutil import copyfile
from sys import exit
import os
import requests
and I am copying the src to the destination using this command:
copyfile(src, dst)
But when I run this program I am given a permission error:
IOError: [Errno 13] Permission denied: 'C:/Users/marti/Desktop/MRL/cover/'
even when I'm running CMD as administrator, does anyone know how to edit these permissions for python?
If not I'm open to any other methods which will allow me to copy an image from one folder to another folder, and eventually check if the src string has changed in which case it will delete the image in the dst folder and replace it
From the shutil doc:
You should pay attention the
dst must be the complete target file name
.