Gratuitous dependencies

Bug #1955727 reported by cetus
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-pip (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Bumped into this on a freshly installed 21.10-server.

Description: Ubuntu 21.10
Release: 21.10
Package version: python3-pip (20.3.4-4 Ubuntu:21.10/impish [all])

When trying to install this package, I get:

$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  build-essential bzip2 cpp cpp-11 dpkg-dev fakeroot fontconfig-config fonts-dejavu-core g++ g++-11 gcc gcc-11 javascript-common
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan6 libatomic1 libc-dev-bin libc-devtools
  libc6-dev libcc1-0 libcrypt-dev libdeflate0 libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl libfontconfig1
  libgcc-11-dev libgd3 libgomp1 libisl23 libitm1 libjbig0 libjpeg-turbo8 libjpeg8 libjs-jquery libjs-sphinxdoc libjs-underscore
  liblsan0 libmpc3 libnsl-dev libpython3-dev libpython3.9-dev libquadmath0 libstdc++-11-dev libtiff5 libtirpc-dev libtsan0
  libubsan1 libwebp6 libxpm4 linux-libc-dev lto-disabled-list make manpages-dev python-pip-whl python3-dev python3-wheel
  python3.9-dev rpcsvc-proto zlib1g-dev
Suggested packages:
  bzip2-doc cpp-doc gcc-11-locales debian-keyring g++-multilib g++-11-multilib gcc-11-doc gcc-multilib autoconf automake libtool
  flex bison gdb gcc-doc gcc-11-multilib apache2 | lighttpd | httpd glibc-doc bzr libgd-tools libstdc++-11-doc make-doc
The following NEW packages will be installed:
  build-essential bzip2 cpp cpp-11 dpkg-dev fakeroot fontconfig-config fonts-dejavu-core g++ g++-11 gcc gcc-11 javascript-common
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan6 libatomic1 libc-dev-bin libc-devtools
  libc6-dev libcc1-0 libcrypt-dev libdeflate0 libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl libfontconfig1
  libgcc-11-dev libgd3 libgomp1 libisl23 libitm1 libjbig0 libjpeg-turbo8 libjpeg8 libjs-jquery libjs-sphinxdoc libjs-underscore
  liblsan0 libmpc3 libnsl-dev libpython3-dev libpython3.9-dev libquadmath0 libstdc++-11-dev libtiff5 libtirpc-dev libtsan0
  libubsan1 libwebp6 libxpm4 linux-libc-dev lto-disabled-list make manpages-dev python-pip-whl python3-dev python3-pip
  python3-wheel python3.9-dev rpcsvc-proto zlib1g-dev
0 upgraded, 64 newly installed, 0 to remove and 0 not upgraded.
Need to get 195 MB of archives.
After this operation, 594 MB of additional disk space will be used.
Do you want to continue? [Y/n]

The list of dependencies seems vastly overblown. I wouldn't have expected pip to need things like libjs-jquery, fonts-dejavu-core, libjpeg8, or indeed nearly all of the other packages listed above. 594 MB does not look reasonable either.

Since the policy unfortunately prevents either pip or ensurepip to be bundled with the main python3.9 package, as they ought to be as per the official Python documentation, I had to download and run get-pip.py to work around this problem. That worked beautifully:

$ python3 get-pip.py
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, pip
Successfully installed pip-21.3.1 wheel-0.37.1
$ du -s .local
11096 .local
$

Thank you.

Revision history for this message
Stefano Rivera (stefanor) wrote :

The python3-pip package does not depend on libjs-jquery, fonts-dejavu-core, or libjpeg8. These are indirect dependencies.

Many are not critical, and if you installed with --no-install-recommends, you'd get a more minimal set. You'd probably need to explicitly add some recommended packages that were needed, though.

libjs-jquery was brought in by python3-dev depending on libjs-sphinxdoc, for the HTML documents it includes.
fonts-dejavu-core was brought in by fontconfig-config, via libc-devtools, a recommendation of libc-dev-bin.
libjpeg8 was also comes care of libgd3 and libc-devtools.

Changed in python-pip (Ubuntu):
status: New → Invalid
Revision history for this message
Neal McBurnett (nealmcb) wrote :

Thank you for the info and tips.
So the way to install a more minimal version is:

sudo apt install --no-install-recommends python3-pip

For me that only required the following additional packages:
  python3-setuptools python3-wheel

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.