Error: failed to commit transaction (conflicting files) - python-pip ; /usr/lib/python3.8

Hello, the command

sudo pacman-mirrors --fasttrack && sudo pacman -Syyu

ended in error:

error: failed to commit transaction (conflicting files)
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/network/pycache/lazy_wheel.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/network/lazy_wheel.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/pycache/datetime.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/pycache/parallel.cpython-38.pyc exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/datetime.py exists in filesystem
python-pip: /usr/lib/python3.8/site-packages/pip/_internal/utils/parallel.py exists in filesystem
Errors occurred, no packages were upgraded.

Can i append --overwrite '*' to the update command in this case? Or which commands to do?

I read i can do " --overwrite path/to/*" and " pacman -Qo /path/to/file" but i do not know which path. If i do /usr/lib/python3.8 it lists so much content. If i try to find python-pip it finds nothing.

$ pacman -Qo /usr/lib/python3.8/site-packages/pip/

/usr/lib/python3.8/site-packages/pip/ is owned by python-pip 20.1.1-1

Since there are only a few files that exist in the filesystem without pacman knowing about them, you can search for each file separately.

For this file for example

run

pacman -Qo /usr/lib/python3.8/site-packages/pip/_internal/network/pycache/lazy_wheel.cpython-38.pyc

to see if this file is owned by any package.

The same way you can check the rest of the 5 files.

If the files are not owned by any package, you can remove them and perform the system update.


In case you want to use the --overwrite option of pacman, you can try:

sudo pacman -Syyu --overwrite usr/lib/python3.8/site-packages/pip/_internal/*

since all the mentioned files in the output are in subdirectories of the _internal directory.

1 Like

Let me guess … you used sudo with pip ?
Dont do that.

For your error:

Update or package installation returns “Failed to commit transaction (conflicting files); FILENAME exists in filesystem”

For not repeating it:

Python - ArchWiki

Looks like we need to recreate this old FAQ/Tut