How To Solve Errors When Installing Packages With Python Dependencies In Arch Linux

Errors When Installing Packages With Python Dependencies

Solve Errors When Installing Packages With Python Dependencies In Arch Linux

Today, I tried to install a package called Torrench from AUR using pacaur helper. The package I tried to install has many Python dependencies. Unfortunately, I couldn’t install it and pacaur kept throwing the following error. I thought the problem would be solved if I remove the conflicting packages. But, I don’t want to break the system. Here is the output error message when I tried to install a program from AUR:

 error: failed to commit transaction (conflicting files)
 python-tabulate: /usr/bin/tabulate exists in filesystem
 python-tabulate: /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc exists in filesystem
 python-tabulate: /usr/lib/python3.6/site-packages/tabulate.py exists in filesystem
 Errors occurred, no packages were upgraded.
 :: Building torrench package(s)...
 ==> Making package: torrench 1.0.56-1 (Mon Oct 23 15:46:37 IST 2017)
 ==> Checking runtime dependencies...
 ==> Installing missing dependencies...
 error: target not found: python-tabulate
 ==> ERROR: 'pacman' failed to install missing dependencies.

As you can see in the above output, the following three packages were the ones that causing the problem.

  1. /usr/bin/tabulate
  2. /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc
  3. /usr/lib/python3.6/site-packages/tabulate.py

To me, deleting them all fixed the problem. However, it is always recommend to check the problematic files are not owned by some other packages. Because If it is owned by some other program, deleting it is bad idea. So, you need to find those conflicting files are not owned by any other packages. The pacman command can easily find out if a file is owned by other packages in your Arch Linux system.

In my case, I checked whether the above mentioned files are owned some other packages as shown below.

sudo pacman -Qo /usr/bin/tabulate

Sample output:

error: No package owns /usr/bin/tabulate
sudo pacman -Qo /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc

Sample output:

error: No package owns /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc
sudo pacman -Qo /usr/lib/python3.6/site-packages/tabulate.py

Sample output:

error: No package owns /usr/lib/python3.6/site-packages/tabulate.py

As you can see, all of the above commands showed me that those files are not owned by any packages. So, I simply deleted them one by one.

sudo rm /usr/bin/tabulate
sudo rm /usr/lib/python3.6/site-packages/__pycache__/tabulate.cpython-36.pyc
sudo rm /usr/lib/python3.6/site-packages/tabulate.py

Done! Now, I can be able to install all packages with Python dependencies. For safety a precaution, backup those conflicting files before deleting them. You can restore them just in case if there are any problems after deleting them.

Cheers!

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You may also like...