close

[Solved] OSError: [Errno 18] Invalid cross-device link

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error OSError: [Errno 18] Invalid cross-device link in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

Today I get the following error OSError: [Errno 18] Invalid cross-device link in python.

  1. How To Solve OSError: [Errno 18] Invalid cross-device link Error ?

    To Solve OSError: [Errno 18] Invalid cross-device link Error os.rename only works if source and destination are on the same file system. You should use shutil.move instead.

  2. OSError: [Errno 18] Invalid cross-device link

    To Solve OSError: [Errno 18] Invalid cross-device link Error os.rename only works if source and destination are on the same file system. You should use shutil.move instead.

Solution 1

os.rename only works if source and destination are on the same file system. You should use shutil.move instead.

Solution 2

I think rename only works when the source and target names are on the same file system. You probably have different mounts. Otherwise you get that error. You can implement the same effect with a copy and a delete.

Hope it helps

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read