0

I´m trying to copy a json file from downloads to my folder. But I keep getting this error:

copyfile("C:/Users/pablo/Downloads/kaggle.json", "C:/Users/juan/.kaggle/")
PermissionError: [Errno 13] Permission denied: 'C:/Users/juan/.kaggle/'

How can I solve this?

  • Check https://stackoverflow.com/questions/11278066/using-shutil-copyfile-i-get-a-python-ioerror-errno-13-permission-denied –  Aug 17 '21 at 17:26

1 Answers1

0

copyfile need as the first argument the input file and as second argument the output file.
You have a / at the end of the output file argument, so python think it is a directory.

If you want to copy the "C:/Users/pablo/Downloads/kaggle.json" file to the directory ".kaggle" then you need to put the filename at the end of the output file argument.

from shutil import copyfile

copyfile("C:/Users/pablo/Downloads/kaggle.json", "C:/Users/juan/.kaggle/kaggle.json")
domx4q
  • 62
  • 6