Dangling python 2.7 package

It seems I still have an old python2.7 package, installed:
$ sudo pacman -Qo /usr/share/doc/libxml2-python-2.9.12/examples/inbuf.py

/usr/share/doc/libxml2-python-2.9.12/examples/inbuf.py is owned by libxml2 2.9.12-3

If I attempt to uninstall it:
$ sudo pacman -R libxml2

checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing libxml2 breaks dependency 'libxml2' required by at-spi2-atk
:: removing libxml2 breaks dependency 'libxml2' required by bind
:: removing libxml2 breaks dependency 'libxml2' required by chromium
:: removing libxml2 breaks dependency 'libxml2' required by docbook-xml
:: removing libxml2 breaks dependency 'libxml2' required by docbook-xsl
:: removing libxml2 breaks dependency 'libxml2' required by ebook-tools
:: removing libxml2 breaks dependency 'libxml2' required by ffmpeg
:: removing libxml2 breaks dependency 'libxml2' required by gspell
:: removing libxml2 breaks dependency 'libxml2' required by gst-plugins-bad
:: removing libxml2 breaks dependency 'libxml2' required by gstreamer
:: removing libxml2 breaks dependency 'libxml2' required by gtksourceview3
:: removing libxml2 breaks dependency 'libxml2' required by gupnp
:: removing libxml2 breaks dependency 'libxml2' required by imagemagick
:: removing libxml2 breaks dependency 'libxml2' required by lib32-libxml2
:: removing libxml2 breaks dependency 'libxml2' required by libabw
:: removing libxml2 breaks dependency 'libxml2' required by libaccounts-glib
:: removing libxml2 breaks dependency 'libxml2' required by libbluray
:: removing libxml2 breaks dependency 'libxml2' required by libcroco
:: removing libxml2 breaks dependency 'libxml2' required by libe-book
:: removing libxml2 breaks dependency 'libxml2' required by libetonyek
:: removing libxml2 breaks dependency 'libxml2' required by libgphoto2
:: removing libxml2 breaks dependency 'libxml2' required by libical
:: removing libxml2 breaks dependency 'libxml2' required by liblangtag
:: removing libxml2 breaks dependency 'libxml2' required by libodfgen
:: removing libxml2 breaks dependency 'libxml2' required by libqalculate
:: removing libxml2 breaks dependency 'libxml2' required by libsoup
:: removing libxml2 breaks dependency 'libxml2' required by libvisio
:: removing libxml2 breaks dependency 'libxml2' required by libxkbcommon
:: removing libxml2 breaks dependency 'libxml2' required by libxklavier
:: removing libxml2 breaks dependency 'libxml2' required by libxml++
:: removing libxml2 breaks dependency 'libxml2' required by libxml++2.6
:: removing libxml2 breaks dependency 'libxml2' required by libxslt
:: removing libxml2 breaks dependency 'libxml2' required by llvm-libs
:: removing libxml2 breaks dependency 'libxml2' required by openbox
:: removing libxml2 breaks dependency 'libxml2' required by openconnect
:: removing libxml2 breaks dependency 'libxml2' required by raptor
:: removing libxml2 breaks dependency 'libxml2' required by rest
:: removing libxml2 breaks dependency 'libxml2' required by shared-mime-info
:: removing libxml2 breaks dependency 'libxml2' required by stoken
:: removing libxml2 breaks dependency 'libxml2' required by wayland
:: removing libxml2 breaks dependency 'libxml2' required by webkit2gtk

This seems to be something that needs to be fixed… but not sure what to do about it.

If I do a locate for libxml2, I find:

/usr/lib/python2.7/site-packages/drv_libxml2.py
/usr/lib/python2.7/site-packages/libxml2.py
/usr/lib/python2.7/site-packages/libxml2mod.so
/usr/lib/python3.9/site-packages/drv_libxml2.py
/usr/lib/python3.9/site-packages/libxml2.py
/usr/lib/python3.9/site-packages/libxml2mod.so

Although there are far more files installed with the 2.7 version than the 3.9 version. (I have not yet updated to 3.10… what I am working towards doing now.

The current version of libxml2 is 2.9.12-6.

So try updating that package as yours is only 2.9.12-3.

Between -3 and -6 they removed the python2 stuff from the package. :slight_smile:

Oh, so the libxml2 for python2.7 package is supposed to still be installed? I thought it needed to be removed since I no longer have python2.7 on this system.

There is no different between the libxml2 library package for python3 and python2. It is the same package. Also the libxml2 package supports other programming languages.

But in recent versions the python2 support was removed.

1 Like

I performed the update, updating to python 3.10.
I now have these remaining in /lib/python3.9/site-packages/

asn1crypto
asn1crypto-1.4.0.dist-info
async_generator
async_generator-1.10.dist-info
attr
attrs-21.2.0.dist-info
h11
h11-0.12.0.dist-info
outcome
outcome-1.1.0.dist-info
scramp
scramp-1.4.1.dist-info
sniffio
sniffio-1.2.0.dist-info
sortedcontainers
sortedcontainers-2.4.0.dist-info
trio
trio-0.19.0.dist-info
trio_websocket
trio_websocket-0.9.2.dist-info
wsproto
wsproto-1.0.0.dist-info

Some may have been installed via pip or as a dependency of a pip install, not sure.
Do I leave these? Or maybe I should manually delete the /lib/python3.9/ directory to clear them out?

Note: The /usr/lib/python2.7 (& libxml2) directory were removed by the update process.

You can re-install them via pip to get them updated to 3.10 versions, but uninstall them if you can.

$ pacman -Qoq /usr/lib/python3.9
error: No package owns /usr/lib/python3.9

I think that from pacman’s perspective, the python3.9 directory is free to be manually removed.
And some of the packages are already installed for 3.10, so uninstalling is an issue:

$ sudo pacman -R python-asn1crypto
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing python-asn1crypto breaks dependency 'python-asn1crypto' required by python-scramp

Edit: I renamed the /lib/python3.9 directory, seems like a reasonable option for now.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.