Oserror: lien inter-appareils non valide

Source and destination need to be on the same file system.
As a fix, use the following instead of os.rename:

shutil.move()
Vivacious Vole