1

I know what pyQt5 is, and I need to use it on a machine that is not mine, on which I know it had been previously installed properly. I inserted

history | grep pyqt

in the Ubuntu terminal in order to see what the previous users have done relatively to pyQt5 installation. pyQt5 works fine on the machine, and I know that all the installations have been carried out via terminal. The relevant outputs of the above command are, as mentioned in the title, pip install pyqt5 and sudo apt-get install python3-pyqt5. Actually, I am more interested in understanding the difference between the two syntaxes and their implication for the operative system, so the fact that I am talking about pyQt5 in particular is just to give some context and maybe to give some practical feedback in case some of you may ask me to input more commands in the terminal.

Thank you!

ps I know there is the documentation both for python-pip and for apt-get, but reading them did not help me to really understand what happens system-wise. It is like I acquired "sealed-off-compartments" knowledge, but then I struggle putting all together.

Jetboy
  • 129
  • 8

1 Answers1

2

apt installs binary .deb packages from apt repositories into system. pip installs binary wheels or source packages from pypi into system or into virtual environment. Python developers publish packages into pypi, you have opportunity to install from apt only if linux distribution maintainers (for some reason) took trouble of packaging for apt. apt packages are likely more stable, pip packages are likely more recent.

mugiseyebrows
  • 4,138
  • 1
  • 14
  • 15
  • So, provided a package is on its final release and with the apt version packaged, i would get almost the same code with the two commands (`pip install` & `apt-get install`)? In this case, it would mean that the pyQt5 of the example, for instance, has been installed twice on that machine? – Jetboy Jul 01 '21 at 09:23
  • 1
    Historically, Debian has been very slow to release new versions, and so typically what they call "stable" will be what the rest of the world calls "old", especially when the Debian version you are using has already been out for a while. (Of course, if you use Debian `sid` you get the freshest available packages, but at the cost of occasional breakage.) – tripleee Jul 01 '21 at 09:46
  • 1
    Indeed, if you install a package twice by different methods, you will end up with two separate installations. `apt-get` has no way of knowing what you have installed elsewhere by way of `pip` (the opposite may or may not be true, depending on how you configured `pip`). – tripleee Jul 01 '21 at 09:46