Ask Your Question

Fix Python site-packages after Fedora system-upgrade?

asked 2018-06-12 00:01:44 -0600

rickhg12hs12 gravatar image

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-12 02:28:20 -0600

villykruse gravatar image

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


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.

edit flag offensive delete link 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.

rickhg12hs12 gravatar imagerickhg12hs12 ( 2018-06-13 08:37:13 -0600 )edit

Also, in fc28 you could install all of these versions


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

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

Question Tools

1 follower


Asked: 2018-06-11 23:57:31 -0600

Seen: 219 times

Last updated: Jun 12 '18