Pacman + python lib conflict

hi all ,
I am in a process of making my ansible roles to install things in my archlabs installation
most packages seem to be straight forward installing them with pacman but when I try few there are some files conflicting ( primarily python libraries )

as an example aws-cli has conflict on python yaml library

Even though I know i could rm -rf the conflicting files/folders I was hopping someone could give me a more native approach to solve this issue.

consider that it could be almost unpredictable of which package might conflict

on a side note. How can I find which package installed the conflicting python yaml library ?

I hope I make sense …
thanks in advance

sudo pacman -Sy aws-cli               
:: Synchronising package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
 archlinuxfr is up to date
resolving dependencies...
looking for conflicting packages...

Packages (7) python-botocore-1.17.27-1  python-jmespath-0.10.0-1  python-pyasn1-0.4.8-2
             python-rsa-4.6-1  python-s3transfer-0.3.3-1  python-yaml-5.3.1-2  aws-cli-1.18.104-1

Total Installed Size:  56.68 MiB

:: Proceed with installation? [Y/n] y
(7/7) checking keys in keyring                               [---------------------------------] 100%
(7/7) checking package integrity                             [---------------------------------] 100%
(7/7) loading package files                                  [---------------------------------] 100%
(7/7) checking for file conflicts                            [---------------------------------] 100%
error: failed to commit transaction (conflicting files)
python-yaml: /usr/lib/python3.8/site-packages/PyYAML-5.3.1-py3.8.egg-info exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/_yaml.cpython-38-x86_64-linux-gnu.so exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__init__.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/__init__.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/composer.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/constructor.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/cyaml.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/dumper.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/emitter.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/error.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/events.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/loader.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/nodes.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/parser.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/reader.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/representer.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/resolver.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/scanner.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/serializer.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/__pycache__/tokens.cpython-38.pyc exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/composer.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/constructor.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/cyaml.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/dumper.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/emitter.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/error.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/events.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/loader.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/nodes.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/parser.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/reader.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/representer.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/resolver.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/scanner.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/serializer.py exists in filesystem
python-yaml: /usr/lib/python3.8/site-packages/yaml/tokens.py exists in filesystem
Errors occurred, no packages were upgraded.                          

*Never* do that: https://wiki.archlinux.org/index.php/System_maintenance#Partial_upgrades_are_unsupported

https://wiki.archlinux.org/index.php/Pacman#.22Failed_to_commit_transaction_.28conflicting_files.29.22_error

2 Likes

Seems like you’ve been using pip as root to install things system wide, avoid this if possible as well. Use pip uninstall then install the relevant package(s) using pacman (FULL update/upgrade first though).

Thanks guys. Will give it s try

scnr…

2 Likes

It’s true, back when I was using BL and the version 2vs3 madness it drove me to check out Arch.

1 Like