1

I want to move a file and I'm having the following bug:

Traceback (most recent call last):
File "G:\Programming\Hack\scripts\# cut file.py", line 4, in <module>
shutil.move(src, dst)
File "C:\Program Files 1\Python2\lib\shutil.py", line 316, in move
copy2(src, real_dst)
File "C:\Program Files 1\Python2\lib\shutil.py", line 144, in copy2
copyfile(src, dst)
File "C:\Program Files 1\Python2\lib\shutil.py", line 97, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'E:\\windows.information.exe'

my script:

import shutil
src = "C:\\Users\\Michael\\Desktop\\windows.information.exe"
dst = "E:\\"
shutil.move(src, dst)

My main problem:

IOError: [Errno 13] Permission denied: 'E:\\windows.information.exe
4

3 Answers 3

0

in fact,this error occurred by permission. in c://Users ,need adminster authority to do it . you should use shutil.copy(src,dst) copy file and authority

Sign up to request clarification or add additional context in comments.

Comments

0

The log shows you do not have proper permissions to access the file. try changing the permissions first

Comments

0

You should take a look at shutil.copy(), since shutil move looks for a file and E: it's a directory and not a file.

import shutil
src = "C:\\Users\\Michael\\Desktop\\windows.information.exe"
dst = "E:\\"
shutil.copy(src, dst)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.