# Fix Python site-packages after Fedora system-upgrade?

After upgrading Fedora with dnf system-upgrade ..., a long time ago actually (F25 to F27), everything worked great after minor tweaks. Recently I had a major problem that took me a while to diagnose.

On a F26 system (soon to be upgraded to F28, I hope), a LaTeX file using LaTeX package minted compiled without issues. The exact directory and subdirectories of files would not compile on a F27 system. The LaTeX compilation error mentioned python, pygments and LaTeX package minted. After much digging around, I discovered that Python version 3.5 site-packages were still on the system and prompt_toolbox from 3.5 was being used by pygments which was being run by the system python3 version 3.6. I tried dnf reinstall python3-prompt_toolbox and it reported that it was NOT installed! python3 version 3.6.5 on my system was using site-packages from an old version of Fedora/Python! After dnf install python3-prompt_toolbox, the original LaTeX file compiled normally.

So, my question is ... There are several Python version 3.5 packages installed in /usr/lib{,64}/python3.5/site-packages. Is there a way to "upgrade" these to the /usr/lib{,64}/python3.6/site-packages directory? Can dnf do this? Should dnf system-upgrade do this? Can pip3 help here?

edit retag close merge delete

Sort by » oldest newest most voted

Wouldn't it be easier just to get minted from the repository?

dnf install texlive-minted.noarch


The packages for pygments are python2-pygments and python2-pygments

Run

find /usr/lib{,64}/python3.5/ -exec rpm -qf {} + > ~/python2.5-list


and you get a list of files which are not provided by any of the rpm packages. Then you can consider whether to remove them or keep them.

pip and pip3 can be dangerous. It has happened in the past that using it broke the system in such a way that dnf didn't work any more.

more

Thanks for your answer. I prefer to use the actual TeXLive system rather than Fedora's. I do use Fedora's python, but also have several environments and local "--user" site-packages. I know this is playing with fire, a bit, but I never add anything to /usr/lib. If there are some old Fedora installs, it would be nice if Fedora cleaned them up during a system-upgrade. I may need to reassess which software I get from Fedora and which I maintain myself.

( 2018-06-13 08:37:13 -0600 )edit

Also, in fc28 you could install all of these versions

python2
python26
python3
python33
python34
python35
python37


but normally you would only have these installed, as dependency of other packages. python2 = version 2.7 python3 = version 3.6

( 2018-06-13 11:02:41 -0600 )edit