This occurs due to files names with the '~' prefix in site-packages. Please remove those files / folders. It will solve your problem.
You can list them with
```bash
ls -a /xx/xx/xx/lib/pythonx.x/site-packages | grep "^~"
```
Then remove files/folders prefixed by '~'.