dh-python dependency removal changing behaviour of installing virtualenv

Bug #1761861 reported by Milind b
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3-defaults (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

root@6de0badbae8b:/# apt-get install --no-install-recommends virtualenv
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  ca-certificates libexpat1 libmpdec2 libpython3-stdlib libpython3.6-minimal libpython3.6-stdlib libssl1.1 mime-support openssl python-pip-whl python3 python3-minimal
  python3-pkg-resources python3-virtualenv python3.6 python3.6-minimal
Suggested packages:
  python3-doc python3-tk python3-venv python3-setuptools python3.6-venv python3.6-doc binutils binfmt-support
Recommended packages:
  bzip2 file xz-utils
The following NEW packages will be installed:
  ca-certificates libexpat1 libmpdec2 libpython3-stdlib libpython3.6-minimal libpython3.6-stdlib libssl1.1 mime-support openssl python-pip-whl python3 python3-minimal
  python3-pkg-resources python3-virtualenv python3.6 python3.6-minimal virtualenv
0 upgraded, 17 newly installed, 0 to remove and 43 not upgraded.
Need to get 7375 kB of archives.
After this operation, 29.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 libssl1.1 amd64 1.1.0g-2ubuntu3 [1128 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 libpython3.6-minimal amd64 3.6.5-3 [529 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic/main amd64 libexpat1 amd64 2.2.5-3 [80.2 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 python3.6-minimal amd64 3.6.5-3 [1425 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 python3-minimal amd64 3.6.5-2 [23.9 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/main amd64 mime-support all 3.60ubuntu1 [30.1 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmpdec2 amd64 2.4.2-1 [82.6 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 libpython3.6-stdlib amd64 3.6.5-3 [1648 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic/main amd64 python3.6 amd64 3.6.5-3 [186 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic/main amd64 libpython3-stdlib amd64 3.6.5-2 [7372 B]
Get:11 http://archive.ubuntu.com/ubuntu bionic/main amd64 python3 amd64 3.6.5-2 [8780 B]
Get:12 http://archive.ubuntu.com/ubuntu bionic/main amd64 openssl amd64 1.1.0g-2ubuntu3 [532 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic/main amd64 ca-certificates all 20170717 [167 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic/universe amd64 python-pip-whl all 9.0.1-2 [1379 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic/main amd64 python3-pkg-resources all 39.0.1-2 [98.8 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic/universe amd64 python3-virtualenv all 15.1.0+ds-1 [43.2 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic/universe amd64 virtualenv all 15.1.0+ds-1 [4376 B]
Fetched 7375 kB in 14s (515 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libssl1.1:amd64.
(Reading database ... 4416 files and directories currently installed.)
Preparing to unpack .../0-libssl1.1_1.1.0g-2ubuntu3_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.0g-2ubuntu3) ...
Selecting previously unselected package libpython3.6-minimal:amd64.
Preparing to unpack .../1-libpython3.6-minimal_3.6.5-3_amd64.deb ...
Unpacking libpython3.6-minimal:amd64 (3.6.5-3) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../2-libexpat1_2.2.5-3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.5-3) ...
Selecting previously unselected package python3.6-minimal.
Preparing to unpack .../3-python3.6-minimal_3.6.5-3_amd64.deb ...
Unpacking python3.6-minimal (3.6.5-3) ...
Selecting previously unselected package python3-minimal.
Preparing to unpack .../4-python3-minimal_3.6.5-2_amd64.deb ...
Unpacking python3-minimal (3.6.5-2) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../5-mime-support_3.60ubuntu1_all.deb ...
Unpacking mime-support (3.60ubuntu1) ...
Selecting previously unselected package libmpdec2:amd64.
Preparing to unpack .../6-libmpdec2_2.4.2-1_amd64.deb ...
Unpacking libmpdec2:amd64 (2.4.2-1) ...
Selecting previously unselected package libpython3.6-stdlib:amd64.
Preparing to unpack .../7-libpython3.6-stdlib_3.6.5-3_amd64.deb ...
Unpacking libpython3.6-stdlib:amd64 (3.6.5-3) ...
Selecting previously unselected package python3.6.
Preparing to unpack .../8-python3.6_3.6.5-3_amd64.deb ...
Unpacking python3.6 (3.6.5-3) ...
Selecting previously unselected package libpython3-stdlib:amd64.
Preparing to unpack .../9-libpython3-stdlib_3.6.5-2_amd64.deb ...
Unpacking libpython3-stdlib:amd64 (3.6.5-2) ...
Setting up libssl1.1:amd64 (1.1.0g-2ubuntu3) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libpython3.6-minimal:amd64 (3.6.5-3) ...
Setting up libexpat1:amd64 (2.2.5-3) ...
Setting up python3.6-minimal (3.6.5-3) ...
Setting up python3-minimal (3.6.5-2) ...
Selecting previously unselected package python3.
(Reading database ... 5099 files and directories currently installed.)
Preparing to unpack .../0-python3_3.6.5-2_amd64.deb ...
Unpacking python3 (3.6.5-2) ...
Selecting previously unselected package openssl.
Preparing to unpack .../1-openssl_1.1.0g-2ubuntu3_amd64.deb ...
Unpacking openssl (1.1.0g-2ubuntu3) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../2-ca-certificates_20170717_all.deb ...
Unpacking ca-certificates (20170717) ...
Selecting previously unselected package python-pip-whl.
Preparing to unpack .../3-python-pip-whl_9.0.1-2_all.deb ...
Unpacking python-pip-whl (9.0.1-2) ...
Selecting previously unselected package python3-pkg-resources.
Preparing to unpack .../4-python3-pkg-resources_39.0.1-2_all.deb ...
Unpacking python3-pkg-resources (39.0.1-2) ...
Selecting previously unselected package python3-virtualenv.
Preparing to unpack .../5-python3-virtualenv_15.1.0+ds-1_all.deb ...
Unpacking python3-virtualenv (15.1.0+ds-1) ...
Selecting previously unselected package virtualenv.
Preparing to unpack .../6-virtualenv_15.1.0+ds-1_all.deb ...
Unpacking virtualenv (15.1.0+ds-1) ...
Setting up mime-support (3.60ubuntu1) ...
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
Setting up openssl (1.1.0g-2ubuntu3) ...
Setting up ca-certificates (20170717) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Updating certificates in /etc/ssl/certs...
148 added, 0 removed; done.
Setting up libmpdec2:amd64 (2.4.2-1) ...
Setting up python-pip-whl (9.0.1-2) ...
Setting up libpython3.6-stdlib:amd64 (3.6.5-3) ...
Setting up python3.6 (3.6.5-3) ...
Setting up libpython3-stdlib:amd64 (3.6.5-2) ...
Setting up python3 (3.6.5-2) ...
running python rtupdate hooks for python3.6...
running python post-rtupdate hooks for python3.6...
Setting up python3-pkg-resources (39.0.1-2) ...
Setting up python3-virtualenv (15.1.0+ds-1) ...
Setting up virtualenv (15.1.0+ds-1) ...
Processing triggers for ca-certificates (20170717) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
root@6de0badbae8b:/# virtualenv
Traceback (most recent call last):
  File "/usr/bin/virtualenv", line 11, in <module>
    load_entry_point('virtualenv==15.1.0', 'console_scripts', 'virtualenv')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 25, in <module>
    import distutils.sysconfig
ModuleNotFoundError: No module named 'distutils.sysconfig'
root@6de0badbae8b:/# virtualenv --version
Traceback (most recent call last):
  File "/usr/bin/virtualenv", line 11, in <module>
    load_entry_point('virtualenv==15.1.0', 'console_scripts', 'virtualenv')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 25, in <module>
    import distutils.sysconfig
ModuleNotFoundError: No module named 'distutils.sysconfig'

The change of removing dh-python dependency will require that the package is deployed before deploying virtualenv

root@6de0badbae8b:/# apt-cache policy python3
python3:
  Installed: 3.6.5-2
  Candidate: 3.6.5-2
  Version table:
 *** 3.6.5-2 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

root@6de0badbae8b:/# apt-cache depends python3
python3
  PreDepends: python3-minimal
  Depends: python3.6
  Depends: libpython3-stdlib
  Suggests: python3-doc
  Suggests: python3-tk
  Suggests: python3-venv
  Replaces: python3-minimal

Tags: bionic
tags: added: bionic
Revision history for this message
Markus Rexhepi-Lindberg (k-markus) wrote :

Why does not python3 depend on dh-python?

I get the following while trying to install python3:

dpkg-query: package 'dh-python' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

What I can tell, every other Ubuntu release has this dependency.

Revision history for this message
Matthias Klose (doko) wrote :

yes, dh-python is a build time dependency. python3-virtualenv now depends on python3-distutils

Changed in python3-defaults (Ubuntu):
status: New → Fix Released
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.